JSTL and locale

R

Rick DeBay

I'm writing out text using <fmt:message>, and I'd like to know what locale JSTL
chose so I can display the proper lang attribute in my HTML tag.
How can I do this with JSTL? Or am I going to have to use a scriptlet?

Thanks, Rick DeBay
 
S

Scott Yanoff

Rick said:
I'm writing out text using <fmt:message>, and I'd like to know what locale JSTL
chose so I can display the proper lang attribute in my HTML tag.
How can I do this with JSTL? Or am I going to have to use a scriptlet?

You can set the locale as shown in this example:
<fmt:setLocale value="en_US" />

I would suppose that if your user (or you) had selected a Locale you
could just feed it into the tag shown above.

Good luck,
 
R

Rick DeBay

You can set the locale as shown in this example:
<fmt:setLocale value="en_US" />

I would suppose that if your user (or you) had selected a Locale you
could just feed it into the tag shown above.

Good luck,

Thanks for the quick reply.
I don't want to set the locale, I want to know what locale JSTL chose when it
had to pick one when processing fmt:message (since no locale is set and sessions
are disabled). As far as I can figure, I'll have to use a scriptlet (or write a
tag) to call response.getLocale().

Rick DeBay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JSTL attempt in JSP 5
JSTL: getting a map's keys 19
JSTL in JEE 2.5 2
Beyond trivial JSTL 1
jstl ? 0
JSTL config question 10
JSF and JSTL 3
(struts/JSTL) Setting bean property value with jstl choose compoundresults 1

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top