Re: Tag Instantiation With JSP 1.2

2003-01-10 Thread Martin Cooper


On Tue, 7 Jan 2003, Tony Colson wrote:

> I have read various email trails and looked at the JSP
> 1.2 spec and am still unclear on something regarding
> custom tags:
>
> I recently upgraded to tomcat 4.1.18 which uses the
> JSP 1.2 spec and in the case
>
> 
>   
> 
>
> where TagA re-evaluates the body several times, it
> seems that TagB only gets instantiated once and
> re-used.  This doesn't seem right to me (even after
> reading the specs) especially since it worked with
> previous versions os tomcat using JSP 1.1.  I would
> think that after the TagB.doEndTag() function the
> container would release() it and thus neccessitate the
> creation of a new TagB object on the next iteration.

The release() method is not required to be called between invocations of a
tag handler. For example, the following sequence of calls into a given
instance of a tag handler is perfectly valid:

  doStartTag()
  doEndTag()
  doStartTag()
  doEndTag()
  release()

See the Lifecycle description in section JSP.10.1.1 of the JSP 1.2 spec
for more information.

--
Martin Cooper


>
> This is important to me because I have underlying data
> structures which are not behaving correctly because of
> this.
>
> Is this a bug?  Are there ways to "force" it to always
> instantiate a new TagB?  Are there alternate
> containers we can use?
>
> Thanks
> Tony
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to Use a forEach Variable in Scriptlet

2003-01-10 Thread Shawn Bayern
On Fri, 10 Jan 2003, Paul Hodgetts, Agile Logic wrote:

> If I have a forEach tag:
>
> 
> How can I access the variable "z" in a scriptlet?
> Something like:
> 
> <% String a = z.name() %>
> 
> but that gives a compiler error when it tries to
> compile the JSP page.  My understanding is that
> z gets put in page scope, but I don't know how to
> access it from there.

JSTL tags don't expose scripting variables.  You'd need either to insert a
 tag or to refer to the scoped attribute, as in

 <% String a = ((MyClass) pageContext.getAttribute("x")).getName(); %>

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to Use a forEach Variable in Scriptlet

2003-01-10 Thread Paul Hodgetts, Agile Logic
If I have a forEach tag:
  

How can I access the variable "z" in a scriptlet?
Something like:

<% String a = z.name() %>

but that gives a compiler error when it tries to
compile the JSP page.  My understanding is that
z gets put in page scope, but I don't know how to
access it from there.

Thanks,
Paul


--
To unsubscribe, e-mail:   
For additional commands, e-mail: