Forums Register Login
JSTL question - format tag library
I've been researching JSTL and found a very informative article from JavaWorld:
In the Format Tag library: format actions section, it says:

In this example, we go the other way�we start with a text string containing a formatted (currency, per the type attribute) field in the value attribute and parse it to obtain a number. The result is typically stored in a variable specified by the var attribute. Although this attribute is optional, you will usually use it; otherwise, the parsed value is simply sent to the page output:
<fmt arseNumber value="${currencyInput}" type="currency" var="parsedNumber"/>

In the bold sentence above, does this mean when a var="[variableName]" is used that the value is ONLY saved to the variable and not output? OR does it mean that the value is saved to the variable in addition to being output? The <c ut> tag is not listed.
Furthermore, on the same page, the <fmt:formatDate> tag is discussed. It says that the format class that handles the formatting is typically java.util.Date. I use GregorianCalendars throughout my applications. How do I customize this tag to get and set values in a GregorianCalendar?
Thanks in advance for your help.
If you use the var attribute, the value of the action will be stored into the variable only. It will default to a page scope variable.You can change the scope by also using the optional scope attribute.
FYI, there are samples of all of the JSTL action in use in the free download that accompanies my book, 'JSTL: Practical Guide for JSP Programmers'
Always look on the bright side of life. At least this ad is really tiny:
Thread Boost - a very different sort of advertising

This thread has been viewed 971 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 20, 2018 02:36:06.