• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to use forward option with parameters

 
sridhar reddy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am having a problem in forwarding the request to a new jsp source, when i am using the <jsp:forward> option with parameters. here is the source code of the page which i am passing to a new jsp source with parameter.
<%@ page language="java" buffer="8kb" %>
<%!
int i = 1;
String err_msg;
%>
<% err_msg = "A Sample Jsp Page";
if (i == 1) {
%>
<jsp:forward page="Error.jsp" >
<jsp aram name="param1" value="<%= err_msg %>" />
</jsp:forward>
<%} %>

And here is the source jsp page ---
<%
String err_msg = request.getParameter("param1");
%>
<%= err_msg %>
The output i am getting is null instead of "A sample Jsp page".
Please help me in this regard.
Thanks in anticipation.
Regards
Sridhar
 
shilpa kulkarni
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this -
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!