You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Henri Yandell <fl...@gmail.com> on 2007/07/23 23:44:14 UTC

[unstandard] Picking through the datetime taglib

Here are the tags in the DateTime taglib:

* currentTime	 Gets the current time in milliseconds since Jan 1, 1970 GMT.
* format	Formats a date in milliseconds since Jan 1, 1970 GMT for
output as a date string.
* parse 	Parses a date string and outputs the time in milliseconds
since Jan 1, 1970 GMT.
* timeZone	Create a time zone script variable for use with the parse
or format tags.

* timeZones	Loop through all time zones.
* months	Loop through the months of the year.
* weekdays	Loop through the days of the week.
* amPms  	Loop through the am/pm names.
* eras         Loop through the era names.

-----

Of the first batch; format and parse are taken of care of in JSTL with
fmt:formatDate and fmt:parseDate. The currentTime tag is effectively
handled by doing:

<jsp:useBean id="now" class="java.util.Date" />

I'm never sure whether it's better to educate people in doing such
things, or if there should be a:

<un:currentTime var="now"/>

Probably it's best to just push towards useBean. Also, the timeZone
attribute to the two fmt: tags can take a String as well as an Object,
so presumably that makes that one redundant.

So the question becomes whether there is any value in the iterator
style tags. I don't see a lot. Any thoughts? I'm tempted to think
'deprecate' for datetime and bring nothing into Unstandard.

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Henri Yandell <fl...@gmail.com>.
Ditto for the i18n taglib. Nothing jumping out there.

On Mon, May 25, 2009 at 2:19 AM, Henri Yandell <fl...@gmail.com> wrote:
> Pulling in an old thread :)
>
> I think datetime taglib should be deprecated. I don't think it is
> interesting enough on top of JSTL to keep alive.
>
> Hen
>
> On Mon, Jul 23, 2007 at 2:44 PM, Henri Yandell <fl...@gmail.com> wrote:
>> Here are the tags in the DateTime taglib:
>>
>> * currentTime    Gets the current time in milliseconds since Jan 1, 1970
>> GMT.
>> * format        Formats a date in milliseconds since Jan 1, 1970 GMT for
>> output as a date string.
>> * parse         Parses a date string and outputs the time in milliseconds
>> since Jan 1, 1970 GMT.
>> * timeZone      Create a time zone script variable for use with the parse
>> or format tags.
>>
>> * timeZones     Loop through all time zones.
>> * months        Loop through the months of the year.
>> * weekdays      Loop through the days of the week.
>> * amPms         Loop through the am/pm names.
>> * eras         Loop through the era names.
>>
>> -----
>>
>> Of the first batch; format and parse are taken of care of in JSTL with
>> fmt:formatDate and fmt:parseDate. The currentTime tag is effectively
>> handled by doing:
>>
>> <jsp:useBean id="now" class="java.util.Date" />
>>
>> I'm never sure whether it's better to educate people in doing such
>> things, or if there should be a:
>>
>> <un:currentTime var="now"/>
>>
>> Probably it's best to just push towards useBean. Also, the timeZone
>> attribute to the two fmt: tags can take a String as well as an Object,
>> so presumably that makes that one redundant.
>>
>> So the question becomes whether there is any value in the iterator
>> style tags. I don't see a lot. Any thoughts? I'm tempted to think
>> 'deprecate' for datetime and bring nothing into Unstandard.
>>
>> Hen
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Henri Yandell <fl...@gmail.com>.
Pulling in an old thread :)

I think datetime taglib should be deprecated. I don't think it is
interesting enough on top of JSTL to keep alive.

Hen

On Mon, Jul 23, 2007 at 2:44 PM, Henri Yandell <fl...@gmail.com> wrote:
> Here are the tags in the DateTime taglib:
>
> * currentTime    Gets the current time in milliseconds since Jan 1, 1970
> GMT.
> * format        Formats a date in milliseconds since Jan 1, 1970 GMT for
> output as a date string.
> * parse         Parses a date string and outputs the time in milliseconds
> since Jan 1, 1970 GMT.
> * timeZone      Create a time zone script variable for use with the parse
> or format tags.
>
> * timeZones     Loop through all time zones.
> * months        Loop through the months of the year.
> * weekdays      Loop through the days of the week.
> * amPms         Loop through the am/pm names.
> * eras         Loop through the era names.
>
> -----
>
> Of the first batch; format and parse are taken of care of in JSTL with
> fmt:formatDate and fmt:parseDate. The currentTime tag is effectively
> handled by doing:
>
> <jsp:useBean id="now" class="java.util.Date" />
>
> I'm never sure whether it's better to educate people in doing such
> things, or if there should be a:
>
> <un:currentTime var="now"/>
>
> Probably it's best to just push towards useBean. Also, the timeZone
> attribute to the two fmt: tags can take a String as well as an Object,
> so presumably that makes that one redundant.
>
> So the question becomes whether there is any value in the iterator
> style tags. I don't see a lot. Any thoughts? I'm tempted to think
> 'deprecate' for datetime and bring nothing into Unstandard.
>
> Hen
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> On 7/23/07, Rahul Akolkar <ra...@gmail.com> wrote:
> > On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> > > Here are the tags in the DateTime taglib:
> > >
> > <snip/>
> > >
> > > So the question becomes whether there is any value in the iterator
> > > style tags. I don't see a lot. Any thoughts? I'm tempted to think
> > > 'deprecate' for datetime and bring nothing into Unstandard.
> > >
> > <snap/>
> >
> > Its upto you :-)
>
> Hope not - I don't use JSP much anymore :)
>
> > The iterators are quite helpful, however, when it
> > comes to i18n'zed old school day and date widgets etc. (for those who
> > haven't switched to AJAXy calendar widgets yet, not that everyone can
> > or should either).
>
> Do they work well with JSTL in their current state?
>
<snip/>

Not sure what you mean, I'd expect iterators to be orthogonal.

-Rahul


> Hen
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Henri Yandell <fl...@gmail.com>.
On 7/23/07, Rahul Akolkar <ra...@gmail.com> wrote:
> On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> > Here are the tags in the DateTime taglib:
> >
> <snip/>
> >
> > So the question becomes whether there is any value in the iterator
> > style tags. I don't see a lot. Any thoughts? I'm tempted to think
> > 'deprecate' for datetime and bring nothing into Unstandard.
> >
> <snap/>
>
> Its upto you :-)

Hope not - I don't use JSP much anymore :)

> The iterators are quite helpful, however, when it
> comes to i18n'zed old school day and date widgets etc. (for those who
> haven't switched to AJAXy calendar widgets yet, not that everyone can
> or should either).

Do they work well with JSTL in their current state?

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> Here are the tags in the DateTime taglib:
>
<snip/>
>
> So the question becomes whether there is any value in the iterator
> style tags. I don't see a lot. Any thoughts? I'm tempted to think
> 'deprecate' for datetime and bring nothing into Unstandard.
>
<snap/>

Its upto you :-) The iterators are quite helpful, however, when it
comes to i18n'zed old school day and date widgets etc. (for those who
haven't switched to AJAXy calendar widgets yet, not that everyone can
or should either).

-Rahul


> Hen
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/24/07, Kris Schneider <kr...@directthought.com> wrote:
> On 7/24/07, Rahul Akolkar <ra...@gmail.com> wrote:
<snip/>
> >
> > Correct, and I punted on that. What is the (new) scope of Unstandard?
> > Something more constrained than "anything thats somewhat useful but
> > not in JSTL"?
>
> Here's the "old and tired" scope:
>
> The Unstandard Tag Library is a collection of tags and features which
> users have requested of the Jakarta Standard Tag Library. It is not
> really tied to the Standard Taglib or JSTL but is instead just
> somewhere to speed the availability of ideas before JSTL responds to
> user demand.
>
> I'm of the opinion that's just fine for the "new hotness" scope. I'm
> just not sure how to quantify the "users have requested" part. I can
> certainly recall people wanting field (constant) and method access,
> but other than that...
>
<snap/>

Yup, that, and logging -- it will be in the archives from roughly
three years ago where I asked about a JCL based log taglib IIRC :-)

Anyway, I can't interpret the old scope in much of a meaningful way,
let alone use it to decide whether the iterator datetime tags actually
belong.

-Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Kris Schneider <kr...@directthought.com>.
On 7/24/07, Rahul Akolkar <ra...@gmail.com> wrote:
> On 7/24/07, Kris Schneider <kr...@directthought.com> wrote:
> > On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> > > Here are the tags in the DateTime taglib:
> > >
> <snip/>
> >
> > > So the question becomes whether there is any value in the iterator
> > > style tags. I don't see a lot. Any thoughts? I'm tempted to think
> > > 'deprecate' for datetime and bring nothing into Unstandard.
> >
> > If I had to recreate the iterator functionality in one of my own apps,
> > I think I'd be tempted to leverage EL functions instead of tags.
> > Simply create a set of static utility methods to generate the
> > collections and then use JSTL iteration. Regardless of how the
> > functionality is implemented (tags or functions), the bigger question
> > is whether or not it ought to be in Unstandard.
> <snap/>
>
> Correct, and I punted on that. What is the (new) scope of Unstandard?
> Something more constrained than "anything thats somewhat useful but
> not in JSTL"?

Here's the "old and tired" scope:

The Unstandard Tag Library is a collection of tags and features which
users have requested of the Jakarta Standard Tag Library. It is not
really tied to the Standard Taglib or JSTL but is instead just
somewhere to speed the availability of ideas before JSTL responds to
user demand.

I'm of the opinion that's just fine for the "new hotness" scope. I'm
just not sure how to quantify the "users have requested" part. I can
certainly recall people wanting field (constant) and method access,
but other than that...

> -Rahul
>
>
> > I've never needed
> > something like it myself, but as Rahul points out, I can see where it
> > might come in handy.
> >
> > > Hen
> >
> > --
> > Kris Schneider <ma...@directThought.com>
> > directThought  <http://www.directThought.com/>

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Rahul Akolkar <ra...@gmail.com>.
On 7/24/07, Kris Schneider <kr...@directthought.com> wrote:
> On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> > Here are the tags in the DateTime taglib:
> >
<snip/>
>
> > So the question becomes whether there is any value in the iterator
> > style tags. I don't see a lot. Any thoughts? I'm tempted to think
> > 'deprecate' for datetime and bring nothing into Unstandard.
>
> If I had to recreate the iterator functionality in one of my own apps,
> I think I'd be tempted to leverage EL functions instead of tags.
> Simply create a set of static utility methods to generate the
> collections and then use JSTL iteration. Regardless of how the
> functionality is implemented (tags or functions), the bigger question
> is whether or not it ought to be in Unstandard.
<snap/>

Correct, and I punted on that. What is the (new) scope of Unstandard?
Something more constrained than "anything thats somewhat useful but
not in JSTL"?

-Rahul


> I've never needed
> something like it myself, but as Rahul points out, I can see where it
> might come in handy.
>
> > Hen
>
> --
> Kris Schneider <ma...@directThought.com>
> directThought  <http://www.directThought.com/>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: [unstandard] Picking through the datetime taglib

Posted by Kris Schneider <kr...@directthought.com>.
On 7/23/07, Henri Yandell <fl...@gmail.com> wrote:
> Here are the tags in the DateTime taglib:
>
> * currentTime    Gets the current time in milliseconds since Jan 1, 1970 GMT.
> * format        Formats a date in milliseconds since Jan 1, 1970 GMT for
> output as a date string.
> * parse         Parses a date string and outputs the time in milliseconds
> since Jan 1, 1970 GMT.
> * timeZone      Create a time zone script variable for use with the parse
> or format tags.
>
> * timeZones     Loop through all time zones.
> * months        Loop through the months of the year.
> * weekdays      Loop through the days of the week.
> * amPms         Loop through the am/pm names.
> * eras         Loop through the era names.
>
> -----
>
> Of the first batch; format and parse are taken of care of in JSTL with
> fmt:formatDate and fmt:parseDate. The currentTime tag is effectively
> handled by doing:
>
> <jsp:useBean id="now" class="java.util.Date" />
>
> I'm never sure whether it's better to educate people in doing such
> things, or if there should be a:
>
> <un:currentTime var="now"/>
>
> Probably it's best to just push towards useBean. Also, the timeZone
> attribute to the two fmt: tags can take a String as well as an Object,
> so presumably that makes that one redundant.

<jsp:useBean> has it's share of semantic "quirks" so it's not always
going to be a useful alternative. It looks like Unstandard already
includes ClassUtils.createInstance(String), and if it was exposed as
an EL function, you could do something like:

<c:set var="currentTime" value="${un:createInstance('java.util.Date')}"/>

> So the question becomes whether there is any value in the iterator
> style tags. I don't see a lot. Any thoughts? I'm tempted to think
> 'deprecate' for datetime and bring nothing into Unstandard.

If I had to recreate the iterator functionality in one of my own apps,
I think I'd be tempted to leverage EL functions instead of tags.
Simply create a set of static utility methods to generate the
collections and then use JSTL iteration. Regardless of how the
functionality is implemented (tags or functions), the bigger question
is whether or not it ought to be in Unstandard. I've never needed
something like it myself, but as Rahul points out, I can see where it
might come in handy.

> Hen

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org