Quoting Randy Belknap ([EMAIL PROTECTED]):
> Justin Wells wrote:
> > Template t = templateSystem.getTemplate("order-template");
> > t.execute(out, context);
> >
>
> Does it have any built in features to handle localization or browser
> dependent behavior? For example, is there a getTemplate() version that
> takes a locale or a browser type and uses it to return the appropriate
> templet?
Not built in. However you could easily implement that--you are in 100%
pure Java and when you call getTemplate() you can pass it any argument
you like. You could easily create a localization scheme.
There's one caveat with localization in template systems, which is that
you have to set the charset BEFORE writing anything to the stream. Usu.
this means you cannot set it inside the template, but rather you have
to set it before you call execute.
You could take care of all these things with some kind of localization
method, like this:
getLocalizedTemplate(Request, Response, name)
and implement that to check the Request for localization data, then
set the charset in the response, and return a localized version of name.
The thing about servlet programming with templates is that you can do
whatever you want. You aren't restricted. You don't even have to choose
to return a template if you don't want to--you can write whatever Java
code you like in your servlet.
Justin
- - -
WebMacro Servlet Framework
http://webmacro.org
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html