"Schachter, Michael" wrote:
> What about using a combination of XML/XSLT to do the localization/device
> detection part? For instance, you have one main jsp page, responsible
> for
> outputting XML data. Say the content would already be localized if you
> were
> to use some Struts i18n tags (currently known as the bean:message tag).
> That way you have your content to display in XML, and then it's the
> responsibility of a taglib to take that XML data and find the correct
> stylesheet to apply to it, depending on some sort of automatic device
> detection done on the part of Struts. Of course, alot of this stuff
> doesn't
> exist, but I'd like to put in this addition for 1.1
I haven't done any XSLT and maybe it is a magic bullet.
Personally, I would prefer the following model:
- A request comes in.
- The action associated with the request calls a bean that
does the device detection part.
(if using servlet 2.3, this could easily be done via
a filter)
- Business logic is processed
- Forward to the appropriate JSP, according to the detection
done previously:
e.g. CustomerList_wml.jsp
CustomerList_html.jsp
CustomerList_xml.jsp
...
What I like about using JSP is that a designer focuses solely on the
syntax of the "presentation language" (along with some JSP tags).
No need to worry about more layers (XML/XSLT).
But I might be missing something in the XML/XSLT story.
Please enlighten me!
-- Pierre