struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Hodgetts, Agile Logic" <>
Subject I18N Issues and Best Practices
Date Thu, 12 Dec 2002 23:13:56 GMT
I've been working on a site that is intended to be fully
I18N.  It's the first site I've tried where I'm really
going for a full and clean separation of the layout from
the content, so please forgive any rookie questions.

I've looked into getting strings into resource files and
also the ways that struts and tiles can choose layouts
based on the country/language as well.  I think I can
figure these out with a little reading and experimenting.

One issue that's got me stumped is how to deal with some
of the finer-grained things on the page.  For example,
when the path and/or name of a graphic file needs to be
dynamically constructed, or the page name for a link, or
the value for a select option.

I find in these areas that the only solution I can get
to work is to embed a piece of scriptlet into the struts
or html tag.  It doesn't seem to be able to parse an
embedded tag that is stuck in the middle of attribute
definition of another tag.

Here's a couple of examples:

* A div where the class name is built with some dynamic
   <div class="header-<%=countryCode%>">

* A struts html:form tag where the action URL is built
using dynamic data:
   <html:form action="action-<%=countryCode%>.do">

* A select option where the value comes from a bean:
   <html:option value="<bean:write name="x" property="y"/>">
   <html:option value="<%=x.getY()%>">

* An image where the source needs a path dynamically
     <html:img src="img/<%=regionCode%>/picture.gif>

Anyway, hopefully that gives you the idea of the types
of issues I'm having trouble with.

I'd really appreciate any tips or pointers to references
on how to get the rest of the scriptlet code out of the
page, in a way that supports i18n of the content.  I've
been looking a bit at custom tags, but I don't quite see
how to use them to solve these issues yet.

Thanks in advance for any help,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message