Wine Vaughn wrote:
>
> My question is about how <jsp:include...> works (with JSP 1.0). (I'm using
> JRun 2.3.2 on NT w/IIS.) Here's my scenario: I've got three JSPs.
> Main.jsp includes either A.jsp or B.jsp, depending on some information
> retrieved from our back end. So Main.jsp has some code in it that looks
> like this:
>
> <jsp:include page=<%= pageToInclude %> />
>
> Now, this works okay and as expected. However, I want to do more than this.
> I want to send particular parameters to each include JSP, like this:
>
> <jsp:include page=<%= pageToInclude %> + "?param1=value1¶m2=value2" %>
> />
>
> Unfortunately, this does work. Everything compiles, but at runtime the
> included JSP cannot retrieve these parameters. Is this because I'm reusing
> the original request?
>
> Is there some other way to accomplish this? Basically, I need a way to pass
> dynamic information to an included JSP.
>
> Do you have some insight on this? I couldn't figure out if this is illegal
> or not from reading the specs and JavaDocs....
Support for query parameters in the ServletContext.getRequestDispatcher,
i.e. the servlet code used by JSP to implement <jsp:include>, is being
considered for the Servlet 2.2 API and hence for JSP 1.1. For the time
being you should be able to pass the information as HttpRequest attributes,
setting them in a scriptlet in Main.jsp and reading them with a scriptlet
in A.jsp and B.jsp. Alternatively I believe you can pass the information
as Beans with request scope (this should actually generate code for setting
and reading HttpRequest attributes).
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".