Hi,
You need to tell Stripes about your custom location of
StripesResources.properties. To do that, edit the WEB-INF/web.xml file
as follows:
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>
net.sourceforge.stripes.controller.StripesFilter
</filter-class>
<!-- other init params...-->
<init-param>
<param-name>
LocalizationBundleFactory.FieldNameBundle
</param-name>
<param-value>com/stripesTest/properties/StripesResources</param-value>
</init-param>
<init-param>
<param-name>
LocalizationBundleFactory.ErrorMessageBundle
</param-name>
<param-value>com/stripesTest/properties/StripesResources</param-value>
</init-param>
</filter>
If you also want to use this resource bundle for JSTL <fmt> tags, you
also need to add this at the top of the WEB-INF/web.xml file:
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.localizationContext
</param-name>
<param-value>com/stripesTest/properties/StripesResources</param-value>
</context-param>
Hope that helps.
Cheers,
Freddy
http://www.stripesbook.com
On Sun, 26 Jul 2009 19:42:29 -0700 (PDT), "shinmen"
<[email protected]> said:
>
> Hi, im having a really really bad time trying to get my stripes test
> project
> (because im a newbie with stripes) running. Ive searched all over the web
> and i didnt find an aswer for my problem. Im using Eclipse Galileo, with
> Tomcat V6.0
>
> I put StripesResources.properties in a package, ie:
> com.stripesTest.properties.StripesResources.properties , and then set the
> next folder in the project buildpath as my default build output folder:
> stripes/WebContent/WEB-INF/classes .
>
> When i access to the home page in the project i get the following
> exception:
>
> GRAVE:
> 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(ResourceBundle.java:1521)
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
> at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
> 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.jsp.calculadora_jsp._jspx_meth_stripes_005fsubmit_005f0(calculadora_jsp.java:250)
> at
> org.apache.jsp.jsp.calculadora_jsp._jspx_meth_stripes_005fform_005f0(calculadora_jsp.java:141)
> at
> org.apache.jsp.jsp.calculadora_jsp._jspService(calculadora_jsp.java:74)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
> at
> org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706)
> at
> org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677)
> at org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
> at java.lang.Thread.run(Thread.java:619)
>
> I checked my classes folder and the resources file is there, but (since
> its
> in a package) its located under the next directory structure:
>
> stripes/WebContent/WEB-INF/classes/com/stripesTest/properties
>
> Is it necessary that the resource file is under /WEB-INF, or it can be
> below other sub folders in /WEB-INF?
>
> How can i define a custom file location for the
> StripesResources.properties
>
> I would really appreciate your help.
>
> best regards,
> --
> View this message in context:
> http://www.nabble.com/StripesResources.properties-configuration-in-Eclipse-Galileo-tp24664157p24664157.html
> Sent from the stripes-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users