Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Included page does not recognize parameter passed! Please help!

Status
Not open for further replies.

joshlam

Programmer
Jul 19, 2000
4
US
Hi,<br><br>I have the following jsp page:<br><br>&lt;jsp:include page=&quot;title.jsp&quot; flush=&quot;true&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&lt;param name=&quot;title&quot; value=&quot;About Our Company&quot;/&gt;<br>&lt;/jsp:include&gt;<br><br>And in the title.jsp page, I have the following:<br><br>&lt;html&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>Title: &lt;%= request.getParameter(&quot;title&quot;) %&gt;<br>&lt;/html&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>But I got the following result on the browser:<br><br>Title: null<br><br>What am I doing wrong?&nbsp;&nbsp;Please help!<br><br>I am using Resin 1.1.2 as my JSP engine on IIS4.<br><br>Thanks in advance!<br><br>--<br>Josh
 
Dear Josh,<br><br>Never used Resin, but using the JWS I would do this:<br><br>&lt;%@ include file=&quot;title.jsp&quot; %&gt;<br><br><br>Now assuming that your outer page contains &lt;html&gt;&lt;/html&gt; tags then you do not want them in your 'title.jsp' file<br><br>Also avoid mutiple &lt;body&gt; tags when using server side includes.<br><br>Hope this helps<br>-pete
 
I found the problem.&nbsp;&nbsp;It should be:<br><br>&lt;jsp:param name=&quot;title&quot; value=&quot;About Our Company&quot;/&gt;<br><br>ie I was missing the &quot;jsp:&quot; before the &quot;param&quot;<br><br>--<br>Josh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top