Stefan,
Thanks so much for your response!
It works.
I spent almost a whole day trying to figure it out but failed!
RGS,
Alan Tang
----- Original Message -----
From: "Stefan Radzom" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 9:56 PM
Subject: RE: passing parameters to another JSP page
There is a little typo in your <jsp:include> which screws up the rest of
your jsp. For your include-action you use an empty-element tag (ending with
"/>") that by definiton contains no child elements. Therefore, the params do
not belong to the include and are never passed on to the included jsp.
Use the corrected code
<jsp:include page="callee.jsp">
<jsp:param name="param2" value="value2" />
<jsp:param name="param3" value="value3" />
</jsp:include>
and everything should work fine.
Stefan
> -----Original Message-----
> From: Alan Tang [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 20, 2003 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: passing parameters to another JSP page
>
>
> Hi,
> Any help would be highly appreciated!
> I'm wondering why it's NOT working passing parameters to
> another jsp page.
> I'm using Tomcat 4.0
> Here is the sample jsp pages I used:
> Called.html:
> <html>
> <head></head>
> <body>
>
> <jsp:include page="callee.jsp" />
> <jsp:param name="param2" value="value2" />
> <jsp:param name="param3" value="value3" />
> </jsp:include>
>
> Caller:
> param1: <%= request.getParameter("param1") %>
> param2: <%= request.getParameter("param2") %>
> param3: <%= request.getParameter("param3") %>
>
> </body>
> </html>
>
> Here is the JSP page being called:
>
> <html>
> <head></head>
> <body>
> Callee:
> param1: <%= request.getAttribute("param1") %>
> param2: <%= request.getParameter("param2") %>
> param3: <%= request.getParameter("param3") %>
> </body>
> </html>
>
> If the caller is called with the URL:
>
> http://135.252.32.142/SIX_XML/scriptJsp/caller> .jsp?param1=a¶m2=b
>
> the expected output would be:
> Callee:
> param1: a
> param2: value2
> param3: value3
>
> Caller:
> param1: a
> param2: b
> param3: null
> The issue is that I always get wrong result with Tomcat 4.0:
> Callee: param1: a param2: b param3: null
> Caller: param1: a param2: b param3: null
> Could anybody tell me what's wrong here?
> Does Tomcat need a special configuration to support passing parameters
> to another JSP page, or I need to use a latter version of Tomcat?
> Thanks much!
> -----
> Alan S. Tang
> Lucent Technologies
> [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]