Thank you for the responses.

Arijit, actually what I need to do is include the same jsp a bunch of times
with a different parameter every time.

Brian, I have actually considered placing the value of "i" into the session
and retrieving it from there in the "included" page.  But I am trying to
avoid changes to the "included jsp", since this is a reuse and the
"included jsp" currently retrieves it from request.  However, so far I have
not found a better way of doing this, so I may have to go with the session.

Another possible solution is to conditionally embed the FOR loop code
directly into the "included jsp", but that does not seem like a better
option in terms of code reuse.

Thanks again to everyone and I welcome any future suggestions.

Elena Tsifrina
SYSCOM, Inc.
www.syscom.com
410-539-3737 x1322




                    Arijit
                    Chakrabarti             To:     [EMAIL PROTECTED]
                    <arijit@REALSOFTI       cc:
                    NC.COM>                 Subject:     Re: Dynamic JSP Include - 
Possible?
                    Sent by: A
                    mailing list
                    about Java Server
                    Pages
                    specification and
                    reference
                    <JSP-INTEREST@JAV
                    A.SUN.COM>


                    12/21/01 12:02 PM
                    Please respond to
                    A mailing list
                    about Java Server
                    Pages
                    specification and
                    reference






Brian,
This method is incorrect way of calling because she is putting the snippet

<jsp:include page="MyForm.jsp" flush="true">
           <jsp:param name="index" value="<%=i%>" />
</jsp:include>
inside the for loop.
So for every iteration it will include the page.
Do you think this is the correct way of calling.
What she intend to do is pass the bunch of values of the possible
iterations
as the param to the next jsp.
Rgds
Arijit






-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Brian Bohnet
Sent: Friday, December 21, 2001 11:45 AM
To: [EMAIL PROTECTED]
Subject: Re: Dynamic JSP Include - Possible?


Arijit,

Could you briefly explain why this way is incorrect? Are you referring
to placing these values in session and extracting them at the second jsp
thru session.getAttribute()?

Thanks,
Brian
Arijit Chakrabarti wrote:
>
> Hi,
> It is possible to have a dynamic JSP parameter.
> But this way of passing parameters is incorrect.
>  value="<%=i%>"
> try to change approach.It will work.
>
> Rgds,
> Arijit
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
> Sent: Friday, December 21, 2001 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: Dynamic JSP Include - Possible?
>
> Hello everyone!
>
> I am attempting to create a jsp page (jsp1) which will include a result
of
> another compiled jsp (jsp2) with dynamic parameters to somewhat of the
> following effect:
>
> <%
> int numForms = 5; //this is a variable that comes from session
>
> for (int i=0; i<numForms; i++)
> {
> %>
>      <jsp:include page="MyForm.jsp" flush="true">
>           <jsp:param name="index" value="<%=i%>" />
>      </jsp:include>
> <%
> }
> %>
>
> My question is: is it possible to have a dynamic JSP parameter.
> I welcome any suggestions about how this can/why it cannot be done.
> Thanks in advance for your help.
>
> Elena Tsifrina
> SYSCOM, Inc.
> www.syscom.com
> 410-539-3737 x1322
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to