You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "PILGRIM, Peter, FM" <Pe...@rbos.com> on 2003/05/02 16:39:10 UTC

[OT] Struts / JSTL fmt:formatDate / Tomcat 4.1.24 lethal concocti on

WARNING: I have just found out that the <fmt:formatDate/> is broken.

I got a Struts application which uses the JSTL FMT FormatDate tag
in a HTML Table. The Standard Taglib 1.0.3 appears to be broken
when used with Tomcat 4.1.24. I get repeated values and I have
checked the database I/O and action form code with JDeveloper 9.0.3 
debugging. I looked into the implementation of the `FormatDateTag'.
Nothing wrong there, then I looked into the actual JSP / Class.
and found that Tomcat Jasper generates JSP using a custom tag 
reuse Pool. This appears to be culprit, because I cannot reproduce 
the error with Oracle 9iAS or with Resin. 

In the JSPC code I see the tag pool is initialised in _jspInit() 
and then released in `_jspDestroy()'. Effective the `Tag.release()'
is only called in the `_jspDestroy()'. I tried doctoring some of
the code in the `doEndTag()'

public void doEndTag() {
    ...

    patternEL="";
}

just for that particular `FormatDateTag'. It did not work. Not
sure if there is work around for JSTL.

I realise that this is not really Struts issue, but ...

--
Peter Pilgrim,
Struts/J2EE Consultant, RBoS FM, Risk IT
Tel: +44 (0)207-375-4923


***********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB 
Regulated by the Financial Services Authority
***********************************************************************

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


RE: [OT] Struts / JSTL fmt:formatDate / Tomcat 4.1.24 lethal concoction

Posted by Joseph Fifield <jf...@programmerplanet.org>.
> In the JSPC code I see the tag pool is initialised in _jspInit() 
> and then released in `_jspDestroy()'. Effective the 
> `Tag.release()' is only called in the `_jspDestroy()'. 

Exactly. This is all that's guaranteed by the spec. This is explained at
http://jakarta.apache.org/taglibs/guidelines.html. Specifically, these
points may point to the problem:

* release() is not necessarily called between invocations, which means
that tag logic should not count on private invocation-specific state
being reset by release()

* doEndTag() is not necessarily called at the end of every invocation
(in cases of abnormal termination -- e.g., an exception thrown inside a
tag's body or by one of its methods)

* private invocation-specific state is thus best initialized in
doStartTag()


Joe




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