Issue 1:
Darren Davison opened SPR-4930 and commented

We have a controller that uses @SessionAttributes, and as such Spring always adds HTTP headers to prevent caching (see AnnotationMethodHandlerAdapter.handle() )

This is causing us a problem in that MSIE users invoke the controller, click links on the page generated by it, and then get the "This page has expired" warning from IE if they hit their back button. Interestingly, if the HTTP headers are set to expire after 1 second, MSIE happily shows the user the page from cache, even though it really HAS expired according to the protocol, so there's definitely (yet another) IE fault at play here too. Firefox and Safari don't exhibit this issue at all.

There is no way to override this behaviour in the AnnotationMethodHandlerAdapter class at present, so I'm wondering if the default behaviour can be made more flexible? Ideally this would be by way of an attribute on the @RequestMapping (or maybe a new annotation) which could be read by the handler adapter. If no value is supplied, it defaults to 0, thus preserving current system behaviour and backwards compatibility, otherwise it specifies the cache seconds to use.

Perhaps adding such an attribute to the RequestMapping/new annotation would provide more benefit in finer grained cache control for annotated controllers, falling back to that set on the handler adapter.

I'll write and test the patch if any of that sounds like it might be acceptable.

Or perhaps there's already some way to handle this that I missed..?

Affects: 2.5.4

Attachments:

SPR-4930.patch (5.14 kB)

Issue 2:
Ailish Byrne opened SPR-2972 and commented

i'm sure i'm just missing something, but i've looked and looked and can't figure out what it is. we are using mutiple BeanNameAutoProxyCreators - for transaction management, caching, and method logging. i upgraded to 2.0.1 then noticed that when a given bean was listed for more that one of the auto proxy creators, only one picked it up. i tried each auto proxy creator in turn and verified that it was working, confirming that the problem was just when more than one was in effect (i think). here is the related configuration from our SpringBeans.xml (slightly simplified to list only one bean for each auto proxy creator):

<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">

<property name="transactionManager">

<ref bean="transactionManager" />

</property>

<property name="transactionAttributeSource">

<bean id="transactionAttributeSource" class="org.kuali.core.util.spring.DefaultingNameMatchTransactionAttributeSource">

<property name="properties">

<props>

<prop key="get*">PROPAGATION_SUPPORTS</prop>

<prop key="is*">PROPAGATION_SUPPORTS</prop>

<prop key="forceLookup*">PROPAGATION_SUPPORTS</prop>

<prop key="noLookup*">PROPAGATION_SUPPORTS</prop>

<prop key="performLookup*">PROPAGATION_SUPPORTS</prop>

<prop key="find*">PROPAGATION_SUPPORTS</prop>

<prop key="search*">PROPAGATION_SUPPORTS</prop>

<prop key="retrieve*">PROPAGATION_SUPPORTS</prop>

<prop key="count*">PROPAGATION_SUPPORTS</prop>

</props>

</property>

<property name="nontransactionalMethods">

<list>

<value>getAllProperties</value>

<value>getPropertyString</value>

</list>

</property>

<property name="defaultTransactionAttribute">

<value>PROPAGATION_REQUIRED</value>

</property>

</bean>

</property>

</bean>

<bean id="transactionAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">

<property name="interceptorNames">

<list>

<idref local="transactionInterceptor" />

</list>

</property>

<property name="beanNames">

<list>

<idref bean="persistenceStructureService" />

</list>

</property>

</bean>

<bean id="methodResultsCacheAdministrator" class="com.opensymphony.oscache.general.GeneralCacheAdministrator" destroy-method="destroy">

<constructor-arg index="0">

<props>

<prop key="cache.memory">true</prop>

<prop key="cache.key">__oscache_mrcache</prop>

<prop key="cache.persistence.overflow.only">false</prop>

<prop key="cache.capacity">1000</prop>

<prop key="cache.event.listeners">org.kuali.core.util.cache.MethodResultsCacheMonitor</prop>

</props>

</constructor-arg>

</bean>

<bean id="methodCache" factory-bean="methodResultsCacheAdministrator" factory-method="getCache" />

<bean id="methodCacheInterceptor" class="org.kuali.core.util.cache.MethodCacheInterceptor">

<property name="cache">

<ref local="methodCache" />

</property>

<property name="expirationTimeInSeconds">

<value>10</value>

</property>

</bean>

<bean id="methodCachePointCut" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">

<property name="advice">

<ref local="methodCacheInterceptor" />

</property>

<property name="patterns">

<list>

<value>org.kuali..PersistenceStructureService...*</value>

</list>

</property>

</bean>

<bean id="resultsCachingProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">

<property name="interceptorNames">

<list>

<idref local="methodCachePointCut" />

</list>

</property>

<property name="beanNames">

<list>

<idref bean="persistenceStructureService" />

</list>

</property>

</bean>

<bean id="methodLoggingPointCut" class="org.springframework.aop.support.DefaultPointcutAdvisor">

<property name="advice">

<bean id="methodLoggingInterceptor" class="org.kuali.core.util.spring.MethodLoggingInterceptor" />

</property>

</bean>

<bean id="methodLoggingProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">

<property name="interceptorNames">

<list>

<idref local="methodLoggingPointCut" />

</list>

</property>

<property name="beanNames">

<list>

<idref bean="persistenceStructureService" />

</list>

</property>

</bean>

Affects: 2.0.1

Issue Links:

#7695 fix of SPR-2721 broke nested proxies ("is duplicated by")