I'm trying to pass the vars to another page to do something with them. I don't know how to forward the values to another page. Help! <head> <title> direction </title> </head> <% String button = request.getParameter("button"); String table = request.getParameter("table"); String c_name = request.getParameter("c_name"); String [] kys = request.getParameterValues("pkey"); if (button == null) { out.print("<html><head></head><body>Please go back and tell me what you want me to do!</body></html>"); } else if (button.equals("Delete Checked Items")) {
} %> <body> <%=button%><br><%=table%><br><%=c_name%><br> <% for (int i=0; i<kys.length; i++) System.out.println("The info is.....: " + kys[i]); %> </body> </html>
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
Get a reference to the requestDispatcher and then use that to forward the request. Just remember that you will not be able to send any output to the client. ex. RequestDispatcher rs = getServletContext().getRequestDispatcher("path/servlet name") rs.forward(yourrequestreference, yourresponsereference)
------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
rich werth
Ranch Hand
Joined: Sep 21, 2001
Posts: 57
posted
0
Thanks I'm using this in stead. Will it cause any problems? String button = request.getParameter("button"); String table = request.getParameter("table"); String c_name = request.getParameter("c_name"); String [] kys = request.getParameterValues("pkey"); if (button == null) { out.print("<html><head></head><body>Please go back and tell me what you want me to do!</body></html>"); } else if (button.equals("Delete Checked Items")) { %> <jsp:forward page="del.jsp" /> <jsp aram name="table" value=table /> <jsp aram name="c_cname" value=c_name /> <jsp aram name="kys" value=kys /> <%}%>
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.