response.sendRedirect() and jsp:forward()
Sir,
I want to pass the variable 'transfer' to 3.jsp. What should I do?. And how?
By using both the option like jsp:forward and response.sendRedirect(), its not working. Why? Can't I do it like this?
Here's my code:
<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>2</title>
</head>
<body>
<%
String name=request.getParameter("name");
String pwd=request.getParameter("pwd");
session.setAttribute("name",name);
String transfer="Teeth";
out.println("<input type=text name=location value=Kolkata maxlength=12 size=12/>");
//response.sendRedirect("3.jsp?action=love");
%>
<jsp:forward page="3.jsp">
</jsp:forward>
</body>
</html>
Thanking you.

