struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (Closed) (JIRA)" <>
Subject [jira] [Closed] (WW-3742) Using dispatcher FORWARD on FilterDispatcher causes ValueStack to be reseted
Date Thu, 12 Jan 2012 08:17:38 GMT


Lukasz Lenart closed WW-3742.

    Resolution: Not A Problem
> Using dispatcher FORWARD on FilterDispatcher causes ValueStack to be reseted
> ----------------------------------------------------------------------------
>                 Key: WW-3742
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions:
>         Environment: Windows 7, Apache Tomcat 5.5.34
>            Reporter: Oleg
>             Fix For: Future
> I need to allow struts 2 filter to work on Forward requests. The reason why I need it
- we need to implement SEO Friendly urls with
> And to make it work transparent for user, the above module does forward of all requests
from user friendly url to "struts-friendly url"
> I have added the following filter mapping to web.xml to allow struts filter to be invoked
on forward:
> {code}
>     <filter>
>         <filter-name>struts2</filter-name>
>         <filter-class>
>             org.apache.struts2.dispatcher.FilterDispatcher
>         </filter-class>
>     </filter>
> ....
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*</url-pattern>
>          <dispatcher>REQUEST</dispatcher>
>          <dispatcher>FORWARD</dispatcher>
>     </filter-mapping>
> {code}
> Also in my  struts.xml I have the following constant set
> {code}<constant name="struts.locale" value="ru_RU"/>{code}
> Just to note that I have all keys ONLY in defined.  
> - has no keys at all
> Now a few experiment that I perform:
> 1) If I call <s:text name="some.key"/> on jsp - text is rendered correctly and
retrieved from "_ru" resource bundle
> 2) Now if I call from my action or from JSP using OGNL "getText" method on key that exists
in "_ru" resource bundle, but do not exists in default resource bundle, I got key returned
itself (e.g. "some.key")
> I've debugged the following method in LocalizedTextUtil class
> {code}
>     public static String findText(Class aClass, String aTextName, Locale locale, String
defaultMessage, Object[] args) {
>         ValueStack valueStack = ActionContext.getContext().getValueStack();
>         return findText(aClass, aTextName, locale, defaultMessage, args, valueStack);
>     }
> {code}
> SO, during <s:text> call "valueStack.context" property, contains 22 values. There
is also "locale" defined, so retrieval of key from resource bundle works correctly.
> But during call to "getText" method, "valueStack.context" contains only 7 values. And
locale is set to en_US
> So looks like context is not initialized

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message