Using struts2 only for internationalization
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi everybody,
I have an application which is not developed in any framework right now that is in English language . I want to make it internationalized by using struts2 but thing is that the struts 2 will not be used in any of the features of that application only for internationalization of that website we have to use it..Kindly Suggest.
Regards,
Lokesh Kumar Pattajoshi
I have an application which is not developed in any framework right now that is in English language . I want to make it internationalized by using struts2 but thing is that the struts 2 will not be used in any of the features of that application only for internationalization of that website we have to use it..Kindly Suggest.
Regards,
Lokesh Kumar Pattajoshi
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Please Ease Up. Every question on Javaranch is "urgent", at least to the person asking it.
Struts 2 is an implementation of a Front Controller. I don't see how one can use it for internationalization without using the Front Controller aspect of it. How would it get invoked?
Perhaps you should look at using resource bundles (since that's how Struts 2 accomplishes localization anyway).
Struts 2 is an implementation of a Front Controller. I don't see how one can use it for internationalization without using the Front Controller aspect of it. How would it get invoked?
Perhaps you should look at using resource bundles (since that's how Struts 2 accomplishes localization anyway).
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Agreed--if you're not using Struts 2, don't use Struts 2--don't just use it for I18N, use resource bundles.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
can we configure front controller in web.xml file?
posted 15 years ago
What one puts in the web.xml file tells the server to use Struts 2 for a particular context, among other things. The actual configuration of Struts 2 happens elsewhere (see here).
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
lokesh pattajoshi wrote:can we configure front controller in web.xml file?
What one puts in the web.xml file tells the server to use Struts 2 for a particular context, among other things. The actual configuration of Struts 2 happens elsewhere (see here).
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thanks joe for your valuable help.can you please tell me who decides which application resources has to call.
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Just use resource bundles and the JSTL and be done with it.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
is resource bundles and the JSTL will be easier as struts 2 i18n ? if you have any link(tutorial) then kindly send me..?
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
The JSTL Specification would be the best resource.
posted 15 years ago
It is if you're not doing anything else with S2, since the S2 message tags requires the pages to be run through an S2 action. It'd be like using a sledge hammer to bang in a push pin into a cork board.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
lokesh pattajoshi wrote:is resource bundles and the JSTL will be easier as struts 2 i18n ?
It is if you're not doing anything else with S2, since the S2 message tags requires the pages to be run through an S2 action. It'd be like using a sledge hammer to bang in a push pin into a cork board.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
i wrote an application in struts2 my application is following below steps..
1)First login Screen will appear
2)Whenever you will give userID and password and click submit button it is going to action for validation i am setting this variable in session
session.setAttribute("org.apache.struts.action.LOCALE", new Locale("fr"));
3)Afeter that from Action class i am forwarding request to success page in success page it is showing the contents in french language.
4) from success page there is another hyper link to UserDetails page in that page the contents are being shown in English language (default).
but there also session.getAttribute("org.apache.struts.action.LOCALE") is returning fr.
kindly suggest how to display french language instead of English in UserDetails page.
Thanks and Regards,
Lokesh Kumar Pattajoshi
1)First login Screen will appear
2)Whenever you will give userID and password and click submit button it is going to action for validation i am setting this variable in session
session.setAttribute("org.apache.struts.action.LOCALE", new Locale("fr"));
3)Afeter that from Action class i am forwarding request to success page in success page it is showing the contents in french language.
4) from success page there is another hyper link to UserDetails page in that page the contents are being shown in English language (default).
but there also session.getAttribute("org.apache.struts.action.LOCALE") is returning fr.
kindly suggest how to display french language instead of English in UserDetails page.
Thanks and Regards,
Lokesh Kumar Pattajoshi
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
http://struts.apache.org/2.1.8/docs/localization.html
http://struts.apache.org/2.1.8/docs/i18n-interceptor.html
Isn't that constant for Struts 1?
You've got multiple people telling you that using Struts 2 *just* for localization is a bad idea, particularly since you *already have a written application*.
Why don't you believe any of us?
http://struts.apache.org/2.1.8/docs/i18n-interceptor.html
Isn't that constant for Struts 1?
You've got multiple people telling you that using Struts 2 *just* for localization is a bad idea, particularly since you *already have a written application*.
Why don't you believe any of us?
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Newton thanks for your replay.Yes that is the constant of both struts 1 and struts 2.
Hope you got tense to me..I always believe to code ranch people that's why i interact a lot with all of you also whenever i get free time i post my comment to others..Really this forum is very very nice one i want to tell thanks to all of you for providing your valuable help to us..
Thanks and Regards
Lokesh
Hope you got tense to me..I always believe to code ranch people that's why i interact a lot with all of you also whenever i get free time i post my comment to others..Really this forum is very very nice one i want to tell thanks to all of you for providing your valuable help to us..
Thanks and Regards
Lokesh
posted 15 years ago
No, no it's not the constant for Struts 2.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
lokesh pattajoshi wrote:Hi Newton thanks for your replay.Yes that is the constant of both struts 1 and struts 2.
No, no it's not the constant for Struts 2.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
But it is also working fine in struts 2 is there any similar constant in struts 2..?
posted 15 years ago
And it's *not* working fine, since the next page doesn't have French on it.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I wrote:http://struts.apache.org/2.1.8/docs/localization.html
http://struts.apache.org/2.1.8/docs/i18n-interceptor.html
And it's *not* working fine, since the next page doesn't have French on it.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
OK.I am using below code for setting locale as fr in action class (session) but still default language is being shown in jsp is there any way to store locale in session
HttpServletRequest request=ServletActionContext.getRequest();
HttpSession session=request.getSession();
session.setAttribute("request_locale","fr");
//session.setAttribute("WW_TRANS_I18N_LOCALE","fr"); //this is also not working
//session.setAttribute("request_only_locale","fr");//this is also not working
also i have configured below code in action
<interceptor-ref name="i18n"/>
<interceptor-ref name="basicStack"/>
HttpServletRequest request=ServletActionContext.getRequest();
HttpSession session=request.getSession();
session.setAttribute("request_locale","fr");
//session.setAttribute("WW_TRANS_I18N_LOCALE","fr"); //this is also not working
//session.setAttribute("request_only_locale","fr");//this is also not working
also i have configured below code in action
<interceptor-ref name="i18n"/>
<interceptor-ref name="basicStack"/>
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi everbody,
is JSTL uses cache to store resource bundle(i am using .properties files as Resource Bundle) ?if yes how can we check..?
Thanks and Regards,
Lokesh
is JSTL uses cache to store resource bundle(i am using .properties files as Resource Bundle) ?if yes how can we check..?
Thanks and Regards,
Lokesh
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Please ask JSP/JSTL questions in the JSP forum.
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Sorry Newton for my mistake..as the topic was running based on JSTL i asked this question OK i am moving it to JSP/JSTL questions.
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
(Since I haven't seen your new post yet, and I'm out the door, see the ResourceBundle Javadocs.)
lokesh pattajoshi
Ranch Hand
Posts: 130
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Not a problem Newton.thanks for your reply i have also moved this topic to JSP forums.
| Paddy spent all of his days in the O'Furniture back yard with this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |













