struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: i18n and <form:html>
Date Wed, 27 Dec 2000 18:04:09 GMT
Pierre Métras wrote:

> Hi Craig,
>
> >
> > Isn't the current implementation a variation on your second suggestion
> already?
> > I chose to make it an attribute of a tag (<form:html>) that you are
> probably
> > using already, instead of an additional tag that needs to be remembered.
> >
> > It seems like overkill to add the logic to every tag that might need it,
> when
> > you can limit the overhead to once per page by using a tag that is only
> used
> > once.  And that is clearly the case for the <form:html> tag.
>
> You can have pages where you don't have forms.
> For instance, my application first page is a graphical menu and I don't want
> to include a form only to allow the user to bookmark that page and have the
> right locale selected.
>

Agreed.

And saying:

    <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
    <form:html locale="true">

        ... my localized content that does not include a form ...

    </form:html>

does what you want, no?

All that is directly rendered is the usual <html> tag at the top, and </html>
tag at the bottom -- the side effect is that Locale processing (from the request
headers) is done in the same way that the controller servlet would have done
it.  There is no HTML <form> tag involved.

The net result is that you can get the correct language (based on the user's
configured preferences) even if they bookmark a JSP page rather than a URL that
goes through the controller.

>
> Pierre Métras

Craig



Mime
View raw message