Topic
  • 5 replies
  • Latest Post - ‏2013-02-12T16:29:46Z by wcrookie
wcrookie
wcrookie
9 Posts

Pinned topic struts2 and dynacache

‏2013-02-12T04:34:06Z |
How can dynacache be used for a struts2 application? Since struts2 uses a filter as opposed to a servlet in struts1, the cachespec.xml entries for my struts actions don't seem to have any effect. Any help much appreciated.
Updated on 2013-02-12T16:29:46Z at 2013-02-12T16:29:46Z by wcrookie
  • bpaskin
    bpaskin
    4282 Posts

    Re: struts2 and dynacache

    ‏2013-02-12T12:23:41Z  
    Hi,

    It depends on what you are trying to cache. Are you trying to cache a particular field, graphic, whole page, etc?

    Regards,
    Brian
  • wcrookie
    wcrookie
    9 Posts

    Re: struts2 and dynacache

    ‏2013-02-12T14:57:46Z  
    I'll need to do both, full page caching and fragment caching.

    How it's structured is I have a struts action 'View' which renders different pages depending on the parameters passed in to the view.
  • bpaskin
    bpaskin
    4282 Posts

    Re: struts2 and dynacache

    ‏2013-02-12T15:05:02Z  
    • wcrookie
    • ‏2013-02-12T14:57:46Z
    I'll need to do both, full page caching and fragment caching.

    How it's structured is I have a struts action 'View' which renders different pages depending on the parameters passed in to the view.
    Hi,

    Have you set the custom property com.ibm.ws.webcontainer.invokefilterscompatibility? This should allow you to cache some stuff based on the filter. It may not always work, but if you caching an entire page, like mypage.jsp, that can be added directly in the cachespec.xml.

    Brian
  • bpaskin
    bpaskin
    4282 Posts

    Re: struts2 and dynacache

    ‏2013-02-12T15:07:14Z  
    • bpaskin
    • ‏2013-02-12T15:05:02Z
    Hi,

    Have you set the custom property com.ibm.ws.webcontainer.invokefilterscompatibility? This should allow you to cache some stuff based on the filter. It may not always work, but if you caching an entire page, like mypage.jsp, that can be added directly in the cachespec.xml.

    Brian
    I found this article that may help you: http://wasdynacache.blogspot.com/2012/04/struts-2-support-for-dynacache.html

    Brian
  • wcrookie
    wcrookie
    9 Posts

    Re: struts2 and dynacache

    ‏2013-02-12T16:29:46Z  
    • bpaskin
    • ‏2013-02-12T15:07:14Z
    I found this article that may help you: http://wasdynacache.blogspot.com/2012/04/struts-2-support-for-dynacache.html

    Brian
    I did come across that but didn't seem to work.

    Using spring or guice to is what I've begin to explore now to try and cache.