How bout this: <c:forEach var="foo" items="${bars}"> <c:import url="some/page.jsp"> <c:param name="foop" value="${foo}"/> </c:import> </c:forEach>
some/page.jsp -------------------- <c:out value="${param.foop}"/>
-Ben
> > > > [c:forEach var="foo" items="${bars}"] > > [c:import url="some/page.jsp"/] > > [/c:forEach] > > > > In this page.jsp I try to access ${foo}, like so: > > [c:out value="${foo}"/]
From: "Rick Ross" <[EMAIL PROTECTED]> Reply-To: "Tag Libraries Users List" <[EMAIL PROTECTED]> To: "Tag Libraries Users List" <[EMAIL PROTECTED]> Subject: Re: c:forEach, c:import and variable scope? Date: Tue, 9 Dec 2003 11:27:54 -0800
I don't have my code in front of me, but I am pretty sure that is exactly what I do for my client. I don't even recall having to set request scope, but I'm not positive there.
Tomcat 5.x/JSTL 1.1
R
----- Original Message ----- From: "Karr, David" <[EMAIL PROTECTED]> To: "Tag Libraries Users List" <[EMAIL PROTECTED]> Sent: Tuesday, December 09, 2003 11:21 AM Subject: RE: c:forEach, c:import and variable scope?
> I can't see how that could work. The "c:import" operation is processing > that URL in an external context. You'd probably have to use > "jsp:include" for that sort of thing. > > > -----Original Message----- > > From: otisg [mailto:[EMAIL PROTECTED] > > > > Here is the problem (using [] to avoid problems with email > > clients not handling HTML well). > > > > Summary: > > c:forEach loop, inside it c:import, but the c:import-ed JSP does > > not see the var from the c:forEach loop. > > > > [c:forEach var="foo" items="${bars}"] > > [c:import url="some/page.jsp"/] > > [/c:forEach] > > > > In this page.jsp I try to access ${foo}, like so: > > [c:out value="${foo}"/] > > > > No go. ${foo} seems undefined there :( page.jsp does not see > > it. Scope issue? > > > > I then tried adding the following inside that c:forEach: > > [c:set var="newFoo" value="${foo}" scope="request"/] > > > > However, that c:import-ed page.jsp does not see ${newFoo} > > either. :( > > > > I am using jakarta-taglibs 1.0.3 with JBoss/Jetty. > > > > Is the above supposed to work? > > How do I get the import-ed page.jsp to see a variable defined in > > the page that imported it? > > > > Thanks, > > Otis > > > > > > ________________________________________________ > > Get your own "800" number > > Voicemail, fax, email, and a lot more > > http://www.ureach.com/reg/tag > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Shop online for kids’ toys by age group, price range, and toy category at MSN Shopping. No waiting for a clerk to help you! http://shopping.msn.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]