On 07-08-2009 at 17:36, Mike McNally wrote: > One could write an action that'd find the right .jsp file. This is > something I'll be needing to do some time soon, but I'm not 100% sure > how to approach it yet. One thing I've thought of is to (somehow; may > or may not be possible) have the top of the .jsp tree in the CLASSPATH > for the web app code. Then the "help" action (or any other > locale-finding action) can poke around using "getResource" to see what > .jsp files are actually available. When it finds one, it can return an > appropriate forward resolution.
When you need to build for and support multiple locales, you'll certainly
have a requirement that states that all translations must be complete.
Use this to your advantage: it also means you may safely assume the
localized JSP page will be there as well.
As a result, you can do this:
Locale locale = getContext().getResponse().getLocale();
return new ForwardResolution("/WEB-INF/jsp/" + locale.getLanguage() +
"/help.jsp");
Having JSP pages in the classpath is not needed. In fact, I've come across a
situation where I wanted to have a JSP page available via the ServiceLoader
mechanism (i.e. via the classpath). But since there is no possibility to
execute the JSP page in code (not in a app.server independent way at least),
I've had to abanbon that approach in favor of a series of taglibs with an
informally required (but ѕadly not fixed) API..
Oscar
--
,-_ Oscar Westra van Holthe - Kind http://www.xs4all.nl/~kindop/
/() )
(__ ( I love deadlines. I like the whooshing sound they make as they fly
=/ () by. -- Douglas Adams
signature.asc
Description: Digital signature
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
