JSTL set locale tags 

Joined:
08/13/2009
Posts:
164

July 27, 2010 18:58:42    Last update: July 27, 2010 18:58:42
The tags

<fmt:setLocale>
<fmt:setLocale value="locale"
[variant="variant"]
[scope="{page|request|session|application}"]/>

The <fmt:setLocale> action stores the locale specified by the value attribute in the javax.servlet.jsp.jstl.fmt.locale configuration variable in the scope given by the scope attribute. If value is of type java.util.Locale, variant is ignored.

This tag should be used at the beginning of the page. Example:
<fmt:setLocale value="en_US"/>


<fmt:requestEncoding>
<fmt:requestEncoding [value="charsetName"]/>

The <fmt:requestEncoding> action may be used to set the request's character encoding, in order to be able to correctly decode request parameter values whose encoding is different from ISO-8859-1.

This action calls the setCharacterEncoding() method on the HttpServletRequest with the character encoding name specified in the value attribute.

Test it
These tags will be tested in later sections.
Share |
| Comment  | Tags