Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirecting to a jsp page on locale switch

PS Ashwin
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a difficult situation with locale change implementation in my web application
I have a web application - struts framework in which I have implemented internationalization.
I have a button at the client header area (header is always visible)to toggle between 2 languages. I have two property files and put the locale information as a session variable. so when toggle happens, I instantiate the resource bundle appropriately and load it into the session and use it across all jsp's. It works fine- no problem.

The issue is :-
as of now, when locale change happens, I make the locale switch in the action class and forward to the home page by default. But the requirement now is that the same jsp (where the user was when he clicked on the toggle button)should be reloaded even when the locale switch happens.

how can i solve it. as a layman I can keep a unique id for all jsp's and then use this forward control to the same jsp from where locale switch action was called. but its a very bad solution I think..
Is there a common well known design to do this ?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic