I'd say there's two approaches to dealing with this.  In the scope of
just this issue, I think "bean:write" is just a little more convenient,
but there may be other considerations.

One way would be to read in your properties file in an action and put
them into application scope.  That's probably overkill just to get the
format keys easily available.

Another way would be to use "fmt:message", referencing the property key,
and placing the result into a variable.  Then, use that variable in the
"fmt:formatDate" tag, for the "pattern" attribute.  If you have a small
number of these, and you reference it in several places, this is
probably a good approach.

> -----Original Message-----
> From: Brian McGovern [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 19, 2005 5:36 AM
> To: Struts Users Mailing List
> Subject: Slightly Off topic: JSTL vs Bean tags w/ message resources
> 
> 
> Hi,
>  
> Got a slightly OT question.  I want to put a date format mask 
> in a properties file and format dates with this key in my 
> presentation jsp.  I can do this with struts bean tags but 
> seeming have to hard code it into the jstl tags.  Both 
> approaches work but i would like to know if anyone has a way 
> to make the properties driven format masking work in jstl.
> 
> 
> Bean:
> <bean:write name="Performance" property="performanceDate" 
> formatKey="conf.dateformat.long" />
> 
> JSTL: 
> <fmt:formatDate pattern="MM/dd/yyyy" 
> value="${Company.membershipStartDate}" />
> 
> thanks
> -B
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to