<jsp:param> Problem

T

Trent

Hello,

I am trying to use the <jsp:include> and <jsp:param> actions. For
whatever reason, I am having zero luck getting the param to be
recognized in the included file. I have two files: index.jsp and
header.jsp:

+++++ index.jsp +++++
<html>
<body>
<jsp:include page="header.jsp">
<jsp:param name="subTitle" value="test 1 2 3"/>
</jsp:include>
This is in index.jsp
</body>
</html>

+++++ header.jsp +++++
Value: ${param.subTitle} <br />


++++++ Output +++++++
Value: ${param.subTitle}
This is in index.jsp


Why is my parameter not getting recognized? This is driving me crazy.
Any help appreciated.
 
H

Heiner Kücker

Trent wrote
Hello,

I am trying to use the <jsp:include> and <jsp:param> actions. For
whatever reason, I am having zero luck getting the param to be
recognized in the included file. I have two files: index.jsp and
header.jsp:

+++++ index.jsp +++++
<html>
<body>
<jsp:include page="header.jsp">
<jsp:param name="subTitle" value="test 1 2 3"/>
</jsp:include>
This is in index.jsp
</body>
</html>

+++++ header.jsp +++++
Value: ${param.subTitle} <br />


++++++ Output +++++++
Value: ${param.subTitle}
This is in index.jsp


Why is my parameter not getting recognized? This is driving me crazy.
Any help appreciated.

Supports your JSP/Servlet Container the specification JSP 2.0 ?

Try

+++++ header.jsp +++++
<%= "" + request.getAttribute( "subTitle" ) %>
or
<%= "" + request.getParameter( "subTitle" ) %>

Good luck

Heiner Kuecker
e-Mail: (e-mail address removed)
Internet: http://www.heiner-kuecker.de
JSP WorkFlow PageFlow FlowControl Navigation: http://www.control-and-command.de
Expression Parser: http://www.heinerkuecker.de/Expression.html
 
T

Trent L

Heiner said:
Trent wrote



Supports your JSP/Servlet Container the specification JSP 2.0 ?

Try

+++++ header.jsp +++++
<%= "" + request.getAttribute( "subTitle" ) %>
or
<%= "" + request.getParameter( "subTitle" ) %>

Good luck


Thanks, that worked. I'll have to double-check
which JSP spec my container is using. I'm running
on JRun 4.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top