Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

null value from getParameter in included jsp

My parent jsp is passing params to the dynamically included jsp using the jsp:param tag. In the included jsp, I am using the  request.getParameter("param") to retrieve the parameters passed from the parent jsp.
Surprisingly, I get a null value out of the request.getParameter("param"); in the included jsp.

Please advice.

Thanks
0
PMagal
Asked:
PMagal
  • 4
2 Solutions
 
bloodredsunCommented:
Can you post your code for this section of your jsp please?
0
 
bloodredsunCommented:
Make sure that you are doing somehting like this:

Parent.jsp
---------------
<html>
<body>
<h2>Start of include</h2><br/>
<jsp:include page="includeme.jsp">
      <jsp:param name="username" value="<%= request.getParameter("page")%>" />
</jsp:include>
</body>
</html>

includeme.jsp
---------------
<html>
<body>
<h2>Eat me</h2><br/>
Page = <%= request.getParameter("page")%>
</body>
</html>

And go to http://localhost:8080/<your_webapp>/parent.jsp?page=hello
0
 
KuldeepchaturvediCommented:
>><jsp:param name="username" value="<%= request.getParameter("page")%>" />

If you do this then in the parent page don't you think you will have to do a

Page = <%= request.getParameter("username")%> instead of "page"??

jsp:include is  gets converted to request.include(rq,rs) so ideally speaking
request.getParameter("page") will also work
0
 
bloodredsunCommented:
You're correct of course! It was a typo as I threw it together
0
 
bloodredsunCommented:
fine with me
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now