The JSTL offers formatting tags ... and it is a standard. Requires Servlet Spec 2.3.

Rick Reumann wrote:

On Thursday, December 12, 2002, 1:43:49 PM, Andy wrote:

AK> I put data storage beans that need to be displayed into the
AK> request or session and use bean:write and logic:iterate on the
AK> JSP. I don't see the sense in creating extra objects targeted to
AK> display; just keeping the get/set methods generic (return a Date,
AK> not a formatted Date String) should be enough.

That's normally exactly what I do as well. I just heard all this
about not having your business objects end up in the presentation
layer so I was concerned about the danger. I guess if this
business object was an EJB that persisted on another server there
could be problems but I'm not in that scenario, although I do want
to do things "to standard" (whatever that is:)
AK> For date formatting, I use the datetime custom tags for dates
AK> (http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html) - a caveat
AK> the format tag uses long values so if your obj has a method Date getDate()
AK> the property in the tag should be "date.time" (which will call the Date
AK> obj's getTime() method that returns a long).

Cool. I'll have to check that out. Thanks.


--
Eddie Bush




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

Reply via email to