Hi all,

I am kinda stuck, maybe i am missing something here.
I wrote this tag, that is used as follows (tomcat being used)

******************************
<test:foreach id="someid" property="someProperty">
//stuff here
</test:foreach>

Here is the appropriate code snippet
(ForEachTag.java)

private String propertyName=null;

public void setProperty(String propertyname)
        {
            this.propertyName=propertyName;
        }


    public int doStartTag() throws javax.servlet.jsp.JspException
        {
            if(propertyName==null)
                {
                    throw new JspException("No property specified");
                }

                //More stuff

        }
********************************

The Problem -

The first time i call the JSP, it seems to work fine but if i call the jsp
again, in finds propertyName to be null and throws the exception.  Now i am
wondering if this is a threading issue cause once the jsp is compiled it
looks like this (relevant portion
only)

------------------------
JspRuntimeLibrary.introspecthelpe(_jspx_th_test_foreach0,"id","queryHandler"
,null,null, false);
JspRuntimeLibrary.introspecthelper(_jspx_th_test_foreach
0,"property","W3ResultsCurrentWindow",null,null, false);
                    try {
                        int _jspx_eval_test_foreach_0 =
_jspx_th_test_foreach 0.doStartTag();
                     -------------------

propertyName would be null if the doStartTag is called before the
setProperty is finished (which would depend on tomcat's introspecthelper
impl) , but the JSP spec says quote - "The doStartTag assumes that any
properties exposed as attributes have been set too".

Could anyone shed some light ?

Help appreciated.

-Jayesh




-----Original Message-----
From: David Wall [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 26, 2000 10:26 AM
To: [EMAIL PROTECTED]
Subject: Re: request scope


> Is there another way to put data into the request scope besides
> <% request.setAttribute("name",request.getParameter("name")): %>

Yes, don't do what you are doing! <wink>  Why would you put the same object
with the same name in the same request object?  It's already there.

David
ExperTrade Corporation

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to