I would suggest that this type of functionality be placed in a JavaBean 
rather than a tag.

I idea is that it is really not up to the page to decide in what format 
a date is displayed. That's really a business requirement that you would 
want to enforce on the Web presentation tier, or a PDF presentation 
tier, or in some type of Word Processing report.

The page needs to decide whether the date property is displayed between 
<TD> elements or <LI> elements, and so forth. But there's no reason for 
the page to worry about formatting the date. Only how to markup the date 
property for a HTML page.

The tags provide the basic funcationality you need to expose JavaBean 
properties to the page but are not intended to be used as part of a 
Model 1 design where business logic and presentation markup are handled 
as a single task.

So, I would take whatever code you might otherwise put in Javascript or 
a custom tag and make it part of the getDate() (or getDateDisplay()) 
method on the JavaBean. Ideally, all the actual formatting should take 
place in a business tier bean, and then the formatted string passed to 
the ActionForm, ready to go.

-T.

edgar wrote:

> I have found that the basic functionality of the tag library classes to
> be limited (I assume by design) , and I have found myself writing
> replacement tags for quite a number of things.  I.E. In order to have a
> relatively simple date interface (avoid very complex javascript in every
> jsp) the logical place to put such code is in the tag libraries.
> 
> Question 1: Am I missing something and is this code is actually being
> produced somewhere else?
> 
> Question 2: Is there a desire for such code to be included in Struts or
> does this bring the user interface too much into the picture?
> 
> Question 3: How complex will life be when moving from version to version
> of Struts if I continue to 'roll my own'?
> 
> Thanks
> 
> Edgar Dollin
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


-- 
Ted Husted, Husted dot Com, Fairport NY US
co-author, Java Web Development with Struts
Order it today:
<http://husted.com/struts/book.html>


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

Reply via email to