wood burning stoves 2.0*
The moose likes Struts and the fly likes changing local and redirecting to same page using struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "changing local and redirecting to same page using struts2" Watch "changing local and redirecting to same page using struts2" New topic
Author

changing local and redirecting to same page using struts2

hitesh sathawane
Greenhorn

Joined: Jun 05, 2009
Posts: 3
I am developing a database driven website using struts2 springs hibernet,
It is a rock climbing information website.
The Information is stored in database in 2 language.
by default internationalization is supported by Struts2,
I want to impliment following functionality.
changing the language in select box should redirect me to same page but with changed language.
Is there any struts2 plugin available for such functionility ?
Do any one have any idea how to implement this functionality.

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Struts 2 provides internationalization it's in built funcationality but it can't read properties from database, we should define in resource bundles http://www.vaannila.com/struts/struts-example/struts-i18n-example-1.html We can display the dynamic content by retrieving from the database but static content declare in resource bundles.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
hitesh sathawane
Greenhorn

Joined: Jun 05, 2009
Posts: 3
I am aware of what you suggested. I wanted to implement this functionality (generalize action to change the local and generate result.
For this I guess if current Urls local parameter is changed we can achieve, but I do not know what would be the mechanizam to trace the current URL

Regards
Hitesh Sathawane
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

generalize action to change the local and generate result.


Can you please elaborate it.

As per your requirement Language preference was change in back-end you can trigger the action and identify the language what is selected and display the content appropriate language.
 
GeeCON Prague 2014
 
subject: changing local and redirecting to same page using struts2