[Struts 2] Internationalization
I've developed a web app using Struts2 - I need to make it display different languages based on the locale of the browser but I'm having a little difficulty getting it to work. Here is a cut down version of what I have: 2 properties files in the default package: narrative.properties: index.welcome=welcome narrative_fr_FR.properties index.welcome=bienvenue 1 jsp: It only ever displays in English despite changing the browser settings. When I'm testing this I ask what the locale is in the action and it returns the correct locale but only ever displays the English version. -- View this message in context: http://www.nabble.com/-Struts-2--Internationalization-tf4653435.html#a13295304 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unable to get Struts 2.0.6 working
I am unable to get my own example web app working with struts 2.0.6 I am using Netbeans 5.5 and tomcat 5.5.17 and have included the following jars: commons-collections-3.2.jar freemarker-2.3.8.jar struts2-core-2.0.6.jar commons-logging-1.0.4.jar ognl-2.6.11.jar xwork-2.0.1.jar struts.xml: http://struts.apache.org/dtds/struts-2.0.dtd";> /StrutsSomething.jsp web.xml: http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> Struts Something struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 *.do index.html When I deploy my webapp no errors are thrown but when i go to http://localhost:8084/MyProject/StrutsSomething.do I get a 404. The port and host are correct as this is the tomcat instance I always use. I have also put breakpoints in my StrutsSomething Action but it is not reaching this code. Please could some one tell me if there is anything in my configuration that I am missing? -- View this message in context: http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358123 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Unable to get Struts 2.0.6 working
No nothing. Musachy Barroso wrote: > > Any error on tomcat's log? > > musachy > > On 3/7/07, ChristopherAngel <[EMAIL PROTECTED]> wrote: >> >> >> I am unable to get my own example web app working with struts 2.0.6 >> >> I am using Netbeans 5.5 and tomcat 5.5.17 and have included the following >> jars: >> >> commons-collections-3.2.jar >> freemarker-2.3.8.jar >> struts2-core-2.0.6.jar >> commons-logging-1.0.4.jar >> ognl-2.6.11.jar >> xwork-2.0.1.jar >> >> struts.xml: >> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >> "http://struts.apache.org/dtds/struts-2.0.dtd";> >> >> >> >> /StrutsSomething.jsp >> >> >> >> >> web.xml: >> http://java.sun.com/xml/ns/j2ee"; >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> >> Struts Something >> >> struts2 >> >> org.apache.struts2.dispatcher.FilterDispatcher >> >> >> >> struts2 >> *.do >> >> >> index.html >> >> >> >> When I deploy my webapp no errors are thrown but when i go to >> http://localhost:8084/MyProject/StrutsSomething.do I get a 404. The port >> and host are correct as this is the tomcat instance I always use. >> >> I have also put breakpoints in my StrutsSomething Action but it is not >> reaching this code. >> >> Please could some one tell me if there is anything in my configuration >> that >> I am missing? >> >> >> >> -- >> View this message in context: >> http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358123 >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > -- View this message in context: http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358308 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Unable to get Struts 2.0.6 working
To be more specific I mean there are no errors: INFO: Reloading this Context has started 07-Mar-2007 17:54:47 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register INFO: Parsing configuration file [struts-default.xml] 07-Mar-2007 17:54:47 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register INFO: Parsing configuration file [struts-plugin.xml] 07-Mar-2007 17:54:47 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register INFO: Parsing configuration file [struts.xml] 07-Mar-2007 17:54:47 org.apache.struts2.config.Settings getLocale WARNING: Settings: Could not parse struts.locale setting, substituting default VM locale 07-Mar-2007 17:54:47 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory INFO: Detected GenericsObjectTypeDeterminer, initializing it... 07-Mar-2007 17:54:47 com.opensymphony.xwork2.util.XWorkConverter getInstance INFO: Detected AnnotationXWorkConverter, initializing it... ChristopherAngel wrote: > > No nothing. > > > Musachy Barroso wrote: >> >> Any error on tomcat's log? >> >> musachy >> >> On 3/7/07, ChristopherAngel <[EMAIL PROTECTED]> wrote: >>> >>> >>> I am unable to get my own example web app working with struts 2.0.6 >>> >>> I am using Netbeans 5.5 and tomcat 5.5.17 and have included the >>> following >>> jars: >>> >>> commons-collections-3.2.jar >>> freemarker-2.3.8.jar >>> struts2-core-2.0.6.jar >>> commons-logging-1.0.4.jar >>> ognl-2.6.11.jar >>> xwork-2.0.1.jar >>> >>> struts.xml: >>> >> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> >>> >>> >>> >>> /StrutsSomething.jsp >>> >>> >>> >>> >>> web.xml: >>> http://java.sun.com/xml/ns/j2ee"; >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> >>> Struts Something >>> >>> struts2 >>> >>> org.apache.struts2.dispatcher.FilterDispatcher >>> >>> >>> >>> struts2 >>> *.do >>> >>> >>> index.html >>> >>> >>> >>> When I deploy my webapp no errors are thrown but when i go to >>> http://localhost:8084/MyProject/StrutsSomething.do I get a 404. The >>> port >>> and host are correct as this is the tomcat instance I always use. >>> >>> I have also put breakpoints in my StrutsSomething Action but it is not >>> reaching this code. >>> >>> Please could some one tell me if there is anything in my configuration >>> that >>> I am missing? >>> >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358123 >>> Sent from the Struts - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> -- >> "Hey you! Would you help me to carry the stone?" Pink Floyd >> >> > > -- View this message in context: http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358348 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Unable to get Struts 2.0.6 working
Yes it does, I am able to go directly to it http://localhost:8084/MyProject/StrutsSomething.jsp Dave Newton-4 wrote: > > A 404? > > Does the JSP exist at the root level of your > deployment? > > --- ChristopherAngel <[EMAIL PROTECTED]> wrote: > >> >> No nothing. >> >> >> Musachy Barroso wrote: >> > >> > Any error on tomcat's log? >> > >> > musachy >> > >> > On 3/7/07, ChristopherAngel <[EMAIL PROTECTED]> >> wrote: >> >> >> >> >> >> I am unable to get my own example web app working >> with struts 2.0.6 >> >> >> >> I am using Netbeans 5.5 and tomcat 5.5.17 and >> have included the following >> >> jars: >> >> >> >> commons-collections-3.2.jar >> >> freemarker-2.3.8.jar >> >> struts2-core-2.0.6.jar >> >> commons-logging-1.0.4.jar >> >> ognl-2.6.11.jar >> >> xwork-2.0.1.jar >> >> >> >> struts.xml: >> >> > >> "-//Apache Software Foundation//DTD Struts >> Configuration 2.0//EN" >> >> "http://struts.apache.org/dtds/struts-2.0.dtd";> >> >> >> >> > extends="struts-default"> >> >> > class="StrutsSomething"> >> >> /StrutsSomething.jsp >> >> >> >> >> >> >> >> >> >> web.xml: >> >> http://java.sun.com/xml/ns/j2ee"; >> >> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> >> >> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >> >> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> >> >> Struts Something >> >> >> >> struts2 >> >> >> >> >> > org.apache.struts2.dispatcher.FilterDispatcher >> >> >> >> >> >> >> >> struts2 >> >> *.do >> >> >> >> >> >> index.html >> >> >> >> >> >> >> >> When I deploy my webapp no errors are thrown but >> when i go to >> >> >> http://localhost:8084/MyProject/StrutsSomething.do I >> get a 404. The port >> >> and host are correct as this is the tomcat >> instance I always use. >> >> >> >> I have also put breakpoints in my StrutsSomething >> Action but it is not >> >> reaching this code. >> >> >> >> Please could some one tell me if there is >> anything in my configuration >> >> that >> >> I am missing? >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> > http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358123 >> >> Sent from the Struts - User mailing list archive >> at Nabble.com. >> >> >> >> >> >> >> > - >> >> To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> >> For additional commands, e-mail: >> [EMAIL PROTECTED] >> >> >> >> >> > >> > >> > -- >> > "Hey you! Would you help me to carry the stone?" >> Pink Floyd >> > >> > >> >> -- >> View this message in context: >> > http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358308 >> Sent from the Struts - User mailing list archive at >> Nabble.com. >> >> >> > - >> To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> For additional commands, e-mail: >> [EMAIL PROTECTED] >> >> > > > > > > Sucker-punch spam with award-winning protection. > Try the free Yahoo! Mail Beta. > http://advision.webevents.yahoo.com/mailbeta/features_spam.html > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9358453 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Unable to get Struts 2.0.6 working
Ah-ha! Thank you! Ian Roughley wrote: > > I think you need to change the struts.properties file to enable .do as > the extension rather than .action - this can also be achieved from the > struts.xml file. > > /Ian > > > ChristopherAngel wrote: >> I am unable to get my own example web app working with struts 2.0.6 >> >> I am using Netbeans 5.5 and tomcat 5.5.17 and have included the following >> jars: >> >> commons-collections-3.2.jar >> freemarker-2.3.8.jar >> struts2-core-2.0.6.jar >> commons-logging-1.0.4.jar >> ognl-2.6.11.jar >> xwork-2.0.1.jar >> >> struts.xml: >> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >> "http://struts.apache.org/dtds/struts-2.0.dtd";> >> >> >> >> /StrutsSomething.jsp >> >> >> >> >> web.xml: >> > xmlns="http://java.sun.com/xml/ns/j2ee"; >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> >> Struts Something >> >> struts2 >> >> org.apache.struts2.dispatcher.FilterDispatcher >> >> >> struts2 >> *.do >> >> >> index.html >> >> >> >> When I deploy my webapp no errors are thrown but when i go to >> http://localhost:8084/MyProject/StrutsSomething.do I get a 404. The port >> and host are correct as this is the tomcat instance I always use. >> >> I have also put breakpoints in my StrutsSomething Action but it is not >> reaching this code. >> >> Please could some one tell me if there is anything in my configuration >> that >> I am missing? >> >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Unable-to-get-Struts-2.0.6-working-tf3363724.html#a9372027 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 Parameter Redirect
Hi, How can I pass a parameter to a struts redirect-action? i.e. given that the doSomething action requires a dynamic parameter, how do I add this parameter to the redirect? doSomething Thank you in advance. -- View this message in context: http://www.nabble.com/Struts-2-Parameter-Redirect-tf3473144.html#a9692568 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Excaption Handling in Struts 2
How do I redirect all Exceptions to a particular jsp page? I've looked at both: http://struts.apache.org/2.x/docs/exception-configuration.html and http://struts.apache.org/2.x/docs/exception-interceptor.html but these have not helped me. In fact they've confused me a little as the examples given don't seem to provide any concrete explanation as to how/why it all hooks together. Not only that but I'm confused by the 1st one talking about the struts-default.xml which I've never seen. -- View this message in context: http://www.nabble.com/Excaption-Handling-in-Struts-2-tf3531450.html#a9855362 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excaption Handling in Struts 2
I think I'm having a bit of a fick day. Not only did I spell "Exception" "Excaption" but I have to ask in which jar can I find it? Dave Newton-4 wrote: > > --- ChristopherAngel wrote: >> Not only that but I'm confused by the 1st one > talking >> about the struts-default.xml which I've never seen. > > Nobody's stopping you ;) It's in the jar; just look at > it. > > d. > > > > > > It's here! Your new message! > Get new email alerts with the free Yahoo! Toolbar. > http://tools.search.yahoo.com/toolbar/features/mail/ > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Excaption-Handling-in-Struts-2-tf3531450.html#a9856062 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excaption Handling in Struts 2
Ah - thank you. Strange that I couldn't see it. Ok I've now redirected all exceptions to a page. How do I now call an action before going to that page? Dave Newton-4 wrote: > > --- ChristopherAngel wrote: >> I think I'm having a bit of a fick day. > > It's almost Friday :) > >> but I have to ask in which jar can I find it? > > Should just be there in struts-core; IIRC it's at the > root level. > > d. > > > > > > Now that's room service! Choose from over 150,000 hotels > in 45,000 destinations on Yahoo! Travel to find your fit. > http://farechase.yahoo.com/promo-generic-14795097 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Excaption-Handling-in-Struts-2-tf3531450.html#a9856384 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excaption Handling in Struts 2
Looks like you're right. I now have: exception WEB-INF/jsp/exception.jsp and it is working. Thank you. Dave Newton-4 wrote: > > --- ChristopherAngel wrote: >> How do I call an action before going to that page? > > This is untested, but AFAICT you should be able to > have the result be whatever type you want, so perhaps > you could send it to a type='action-redirect'? > > http://struts.apache.org/2.x/docs/exception-interceptor.html > > Post a followup with what you discover; I suspect > there will be a lot of people interested in the > results, and it can be added to the wiki. > > HTHCIG*, > d. > > * Hope This Helps 'Cuz I'm Guessing ;) > > > > > > No need to miss a message. Get email on-the-go > with Yahoo! Mail for Mobile. Get started. > http://mobile.yahoo.com/mail > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Excaption-Handling-in-Struts-2-tf3531450.html#a9856670 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 Jasper Reports Plugin
I have the following package defined in my struts.xml file: reports/report.jasper dataSource the generateReport method is called as expected except despite ReportAction implementing ServletRequestAware the setServletRequest method is never called. How can I get access to the HttpServletRequest object from within the generateReport method? -- View this message in context: http://www.nabble.com/Struts-2-Jasper-Reports-Plugin-tf3552530.html#a9918148 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Jasper Reports Plugin
Apparently using HttpServletRequest request = ServletActionContext.getRequest(); So why is the setServletRequest method not called? ChristopherAngel wrote: > > I have the following package defined in my struts.xml file: > > >method="generateReport"> > > reports/report.jasper > dataSource > > > > > the generateReport method is called as expected except despite > ReportAction implementing ServletRequestAware the setServletRequest method > is never called. > > How can I get access to the HttpServletRequest object from within the > generateReport method? > > > -- View this message in context: http://www.nabble.com/Struts-2-Jasper-Reports-Plugin-tf3552530.html#a9918621 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]