-----Original Message-----Hi Magnus,
From: Eric Richardson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 25, 2000 10:37 AM
To: Orion-Interest
Cc: Orion-Interest; [EMAIL PROTECTED]
Subject: Re: Tag Example ProblemI resolved my problem and think it is a bug. I did recompile with no avail.
Karl wrote me back and suggested from now on if I found what I think is a bug to copy it to [EMAIL PROTECTED] He said he would add that to the Web site.When this call is made in 0.9.6 the bean goes in application scope.
pageContext.setAttribute(name, iterator.next(), PageContext.PAGE_SCOPE);I changed to the two arg version which for pageContext puts bean in page scope which
solves the problem temporarily.
pageContext.setAttribute(name, iterator.next());Thanks,
Eric :-)Magnus Rydin wrote:
The taglib's probably needs to be recompiled using the latest orion.jar, as there was a problem with comilers replacing static variables with their values.Please see note on www.orionserver.comI will update the taglibs in all examples asap.WRMagnus Rydin-----Original Message-----Hi,
From: Eric Richardson [mailto:[EMAIL PROTECTED]]
Sent: den 18 april 2000 17:12
To: Orion-Interest
Subject: Tag Example Problem
I searched the archives and couldn't find anything relevent.I'm trying to use the Iterate.java tag in some code I have. I pass the collection but the nested usebean tag cannot find the object in page scope.
500 Internal Server Error
java.lang.InstantiationException: Could not find the bean named 'product1' in the page scope
at /product_demo.jsp._jspService(/product_demo.jsp.java:171)
at com.evermind.server.http.EvermindHttpJspPage.service(JAX)
at com.evermind.server.http.HttpApplication.r4(JAX)
at com.evermind.server.http.JSPServlet.service(JAX)
at com.evermind.server.http.c9.oh(JAX)
at com.evermind.server.http.c9.forward(JAX)
at com.evermind.server.http.dg.b8(JAX)
at com.evermind.util.e.run(JAX)If I put an object in scope of the correct type it iterates through the list and prints everything out so I know the collection is fine.
<% pageContext.setAttribute("product1", product);<ts:iterate name="product1" collection="<%= products %>">
<jsp:useBean id="product1" scope="page" type="com.ratex.db.Product"/>
<!-- Product: <%=product1 %> -->
<tr>
<td>
<jsp:getProperty name="product1" property="productId"/>
</td>
<td> <%=product1.getCategory() %> </td>
<td> <%=product1.getName() %> </td>
<td> <%=product1.getDescription() %> </td>
</tr>
</ts:iterate>I haven't quite figured out the code but it seems it should work correctly. Seems like the
setAttribute(...) is not getting called.public int doStartTag() {
if(iterator == null) { //Make sure we have a Iterator
return SKIP_BODY;
}
if(iterator.hasNext()) { //check if we got more elements
// add the Bean to the pageContext using the given name
pageContext.setAttribute(name, iterator.next(), PageContext.PAGE_SCOPE);
return EVAL_BODY_TAG;
}
else {
return SKIP_BODY;
}
}Any help would be appreciated.
Eric :-)
Hi
Eric:
The
bug you mentioned has been corrected in an internal build of Orion
already. This release is currently under regression testing and will be
available shortly.
--
Victor
- Tag Example Problem Eric Richardson
- Re: Tag Example Problem Eric Richardson
- Re: Tag Example Problem ***Possible bug*** Eric Richardson
- RE: Tag Example Problem Magnus Rydin
- Re: Tag Example Problem Eric Richardson
- Victor A. Salaman