Oi Rodrigo,

I would have expected Stripes to find your StripesResources.properties file, given that it was placed in WEB-INF/classes, and the file name & root package location are the same as the default.

Some things to check:
1. Is StripesResources.properties *definitely* getting bundled into your war file and placed into WEB-INF/classes? 2. Do you have any incorrectly-set LocalizationBundleFactory init- params for the StripesFilter in web.xml that are causing Stripes to look in the wrong place? (See below)

When using non-default Stripes localization bundles, you need to do some extra configuration for Stripes. See the configuration docs. In your case, you could try the config below, but I think that it is redundant since its equivalent to the default setting:

        <init-param>
            <param-name>LocalizationBundleFactory.ErrorMessageBundle
            </param-name>
            <param-value>StripesResources</param-value>
        </init-param>
        <init-param>
<param-name>LocalizationBundleFactory.FieldNameBundle</ param-name>
            <param-value>StripesResources</param-value>
        </init-param>

As the localization docs imply, JSTL localization and Stripes localization are independent of each other, but can read from the same resource bundle.

Boa sorte!

Chris.

On Jan 21, 2009, at 9:32 AM, Rodrigo Malara wrote:

Hello,

I'm new to Stripes and building my first web app using it.
I'm having a bad time configuring localization for it. I'll do my best to explain my problem and how things are setup. The problem is that I'm getting the stack trace below when using a <stripes:button .../> tag on a JSP page. Below is the snippet than the stack trace:

<s:form beanclass="xx.com.xxx.xxx.actions.EstadoActionBean">
  <s:button name="listar" value="label.insert" />
</s:form>

java.util.MissingResourceException: Could not find the form field resource bundle needed by Stripes. This almost certainly means that a properties file called 'StripesResources.properties' could not be found in the classpath. This properties file is needed to lookup form field names. Please ensure the file exists in WEB-INF/classes or elsewhere in your classpath. at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
    at java.util.ResourceBundle.getBundleImpl(Unknown Source)
    at java.util.ResourceBundle.getBundle(Unknown Source)
at net .sourceforge .stripes .localization .DefaultLocalizationBundleFactory .getFormFieldBundle(DefaultLocalizationBundleFactory.java:113) at net .sourceforge .stripes .localization .LocalizationUtility.getLocalizedFieldName(LocalizationUtility.java: 66) at net .sourceforge .stripes .tag.InputTagSupport.getLocalizedFieldName(InputTagSupport.java:269) at net .sourceforge .stripes .tag.InputTagSupport.getLocalizedFieldName(InputTagSupport.java:238) at net .sourceforge .stripes .tag.InputButtonSupportTag.doEndInputTag(InputButtonSupportTag.java: 75) at net .sourceforge .stripes.tag.InputTagSupport.doEndTag(InputTagSupport.java:442) at org .apache .jsp .WEB_002dINF .jsps .listaEstados_jsp ._jspx_meth_s_005fbutton_005f0(listaEstados_jsp.java:249)
....

But using JSTL <fmt:message key="label.insert" /> it works fine.

My web.xml file has the following config regarding localization, as proposed by Stripes web page:
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</ param-name>
    <param-value>StripesResources</param-value>
  </context-param>

And the StripesResources.properties is located at WEB-INF/classes/ StripesResources.properties

I've Googled around and didn't find anything that could help me out.
If you have any clue on how I can solve this, I would appreciate.

Thanks
Rodrigo

Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 - Celebridades - Música - Esportes ------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to