See comments inline. ----- Original Message ----- From: "Miroslav Kes" <[EMAIL PROTECTED]>
> Hi, > > I started experimenting with WW some days ago trying to convert a simple > application in which I originaly used Struts. Now I got to the point > when I would like to deploy it but found there was one open question left. > > How does the WW access resource bundles for i18n-ized texts? > > I looked at the i18n example but I haven't found how does the app. know > it should use the Shop.properties to retrieve data for particular > language. In Struts there is one resource bundle and it is referenced as > one of parameters of the dispatch servlet in the web.xml. I havent found > any such information in the documentation supplied with WW (1.3.0) > The text tag will try to find the method: getText(someKey) on the value stack. This means that it will find this method in the action that just executed (if the action extends ActionSupport where this method is defined). The getText method will look for a resource bundle matching the action's class. If not found, it will look for one matching the superclass of the action, and so on. > Does it mean I have to have separate resource bundles for each action > class? What about the inheritance? No you can gather them in a superclass if you want to. You could use the webwork.action.ActionSupport class (if all your actions are extending it). > What about the JSP? Does it use the resource bundle belonging to the > action for which the page serves as the view? Yes this is the normal case. > If so, what if a page servers as a view for more actions? The action that just executed is pushed on the stack and it is this action that will be found. If the same view is used for another action in another scenario then that action will be on the stack then. > Is there a way to have just one i18n-ized resource bundle for the whole > application? Yes, by using a superclass. There is also the possibility to use the i18n tag to put a special bundle on the stack. > Is this the reason why all actions in the i18n example inherit from the > webwork.action.ActionSupport.Shop class? > I have not looked at that example for a while, but that could be one reason anyway. > Can anybody explain me how this works? It would be also good to mention > that in the WW documentation. Hope this helped! Cheers, Dick Zetterberg [EMAIL PROTECTED] ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork