[Logo]
Forums Register Login
JSTL question - format tag library
I've been researching JSTL and found a very informative article from JavaWorld:
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl_p.html
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'
HTH
Sue
You may have just won ten million dollars! Or, maybe a tiny ad.
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 1004 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 19, 2018 03:52:45.