Is there a Java API for the JSTL tags?

J

Joop Kaashoek

Is there a way to use the functionality offered by the JSTL tags in
Java code? We have some Java methods defined in JSP pages and would
like to access some FMT tag funcionality from within Java. We could
also put our Java code in custom tags but are looking to avoid this.

Thanks & Regards,

Joop Kaashoek
 
T

Tor Iver Wilhelmsen

Is there a way to use the functionality offered by the JSTL tags in
Java code?

Yes, by instancing the tag objects manually and invoking the relevant
methods. But why would you want to use components for something
they're not designed for?
 
J

Joop Kaashoek

Tor Iver Wilhelmsen said:
Yes, by instancing the tag objects manually and invoking the relevant
methods. But why would you want to use components for something
they're not designed for?

We just have defined a UI component in Java that is re-used many times
and now we want to pass it a localized string, i.e. use the
<fmt:message ..> mechanism to come up with the localized string and
tehn pass it to a Java method, or pass the original property name to
the Java method and have it access the resource bundle transliation
facility somehow.

Or can you create re-usable JSTL components somehow?
 
J

Joop Kaashoek

I Actually found the Java API for localization, it is found in
'javax.servlet.jsp.jstl.fmt.LocaleSupport', according to the very
useful book 'core JSTL Mastering the JSP Standard Tag Library'
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top