response.sendredirect

response.sendredirect

hi friends, i have a doubt.pls clarify it(if u know). i have a first.jsp file. In that i have some checkboxes. i will select some of those check boxes and i need to froward those details to my second.jsp

View Answers

April 28, 2008 at 6:53 PM

Hi friend,

This is form code,

<html>
<head>
<title>multiple selection option in jsp</title>
</head>
<body>
<table border="1" width="40%" cellspacing="0" cellpadding="0" bgcolor="#CCCCFF">
<tr>
<td width="100%">
<form method="POST" action="multiSelectionAction.jsp">
<center><b>Select Multiple Option:</b><br><br>
<table border="1" width="100%" cellspacing="0" cellpadding="0" bgcolor="#CCFFFF">
<tr>
<td width="50%"><b>Cricket</b></td>
<td><input type=checkbox name=multi VALUE=Cricket></td>
</tr>
<tr>
<td width="50%"><b>Football</b></td>
<td><input type=checkbox name=multi VALUE=Football></td>
</tr>
<tr width="50%"><td><b>Tennis</b></td>
<td><input type=checkbox name=multi VALUE=Tennis></td>
</tr>
<tr>
<td width="50%"><b>Rugby</b></td>
<td><input type=checkbox name=multi VALUE=Rugby></td>
</tr>
<tr>
<td width="50%"><b>Basketball</b></td>
<td><input type=checkbox name=multi VALUE=Basketball></td>
</tr>
<tr>
<td width="50%"><input type=submit name=submit Value="Submit"></td>
<td>&nbsp;</td>
</tr>

</table> <br>
</center>
</form>
</td>
</tr>
</table>
</body>
</html>

--------------------------

<%@ page language="java" %>

<%! String[] multi; %>
<center>You have selected:
<%
multi = request.getParameterValues("multi");
if(multi != null){
for(int i = 0; i < multi.length; i++){
out.println(i);
out.println ("<b>"+multi[i]+"<b>");
}
}
else
out.println("<b>none<b>");
out.println("<br/>");
out.println("<br/><a href=multipleSelectCheckbox.jsp><b>Back to Home</b></a>");
%>

--------------------------


read for more information,

http://www.roseindia.net/jsp/









Related Tutorials/Questions & Answers:
response.sendRedirect(); - JSP-Servlet
response.sendRedirect();  What is the purpose of using response.sendRedirect(); method?  Use of sendRedirect Use sendRedirect if u doesn?t want to carry forward the request and response objects. sendRedirect is done
response.sendredirect - JSP-Servlet
response.sendredirect  hi friends, i have a doubt.pls clarify it(if u know). i have a first.jsp file. In that i have some checkboxes. i will select some of those check boxes and i need to froward those details to my second.jsp
Advertisements
jsp - JSP-Servlet
jsp  hi response.sendRedirect("http://localhost:8085/RetailBusinessSuite/suite/process/login.jsp"); not redirect in following code ------------------- "/> "/> "/>
java - JSP-Servlet
java  what is meant by response.sendRedirect(). what is the difference between response.getRequestDispatcher() and getRequestDispatcher what is meant by absolute path and relative path.give me a small example
question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me
send redirect in JSP - JSP-Servlet
the following code: If id = administration { response.sendRedirect..." == ********** response.sendRedirect("backtohome.jsp"); } I want
java - JSP-Servlet
{ response.sendRedirect("/servletApp/myServlet2"); } } response.sendRedirect
Passing Parameter Values to another jsp in Query Strings
... response.sendRedirect("http://localhost:8080/SWIFT/index.jsp?loginid='"+loginid...?  Hi All:) I found the solution give response.sendRedirect("http
response.sendDirect
response.sendDirect  Is this response.sendDirect correct? response.sendRedirect("register.jsp?firstNameURL="+request.getParameter("cust_firstName... follow this way: response.sendRedirect("/examples/jsp/index.jsp?uname
How to carry multiple values from a Servlet to a JSP?
How to carry multiple values from a Servlet to a JSP?  By using the below code I am able to carry the username to a JSP (single value). ----response.sendRedirect("index.jsp?uname="+username);---- But I want multiple values
question
question  good afternoon, how to send values retrieved from database to user interface text box via response.sendRedirect or have any option to redirect selected values from database to same user interface who where in.please
servlet - Java Beginners
servlet  Hi Guys, if i will use response.sendRedirect means the data will forward with in a same web application and also in different web... : response.sendRedirect("Url"); For read more information on Servlet visit to : http
Jsp redirect
response.sendRedirect() through which the server sends the response to the client...://www.roseindia.net/"; response.sendRedirect(redirectURL); %> <
Login Query
))) { response.sendRedirect("/student...))) { response.sendRedirect("/employer..."); response.sendRedirect("index.jsp
servlet
(bean, con); response.sendRedirect("adding_productmodel.jsp...{ service.updateProduct(bean, con); response.sendRedirect("updating_productmodel.jsp
servlet
(bean, con); response.sendRedirect("adding_productmodel.jsp...{ service.updateProduct(bean, con); response.sendRedirect("updating_productmodel.jsp
I want solution for this jsp program..
"))) { session.setAttribute("username",dbusername); response.sendRedirect("Home.jsp"); } else { response.sendRedirect("Error.jsp
JSP & Servlet - JSP-Servlet
JSP & Servlet  In the process of login validation. i'm entering the username correct and pass wrong. when using response.sendRedirect() a new req and resp wil be processed, so the user has to enter the username again and try
servlet - Java Beginners
the data to different web application using response.sendredirect how
JSP & Servlet - JSP-Servlet
JSP & Servlet  Its an IBM Question In the process of login validation. i'm entering the username correct and pass wrong. when using response.sendRedirect() a new req and resp wil be processed, so the user has to enter
Radio button validation using jsp - JSP-Servlet
this collect radiobutton value if value is null response.sendredirect("/urjsppage
java - JSP-Interview Questions
java  what is the difference between response.sendRedirect() and forward() methods?  Hi JSP forward action transfers the control to a static or dynamic resource. The static or dynamic resource to which control
logout validation - JSP-Servlet
session.invalidate(); response.sendRedirect("../here the path of your home page
sendRedirect to multiple links
sendRedirect to multiple links  hello , In my servlet page , i'm using response.sendRedirect("http://ubaid.tk/sms/sms.aspx?uid="+fromNumber+"&pwd="+passWord+"&msg="+msg+"&phone="+toNumber+"&provider="+provider
Clearing session in jsp
"); session.invalidate(); response.sendRedirect("Login.jsp"); %> thanks
login authentication - Java Beginners
("successfully logged in"); response.sendRedirect..."); response.sendRedirect("HrmsLogin.jsp
Servlet & Jsp - Java Interview Questions
"))){ String destination ="./jsp/loginSuccess.jsp"; response.sendRedirect... ="./jsp/error.jsp"; response.sendRedirect(response.encodeRedirectURL
Servlet - JSP-Servlet
); response.sendRedirect("welcome.jsp"); } else { response.sendRedirect("user.jsp"); } } catch (Exception e
servelets - Java Beginners
); } if((user1.equals(user))&&(pass1.equals(pass))){ response.sendRedirect("jsp/welcome.jsp"); } else{ response.sendRedirect("jsp/login.jsp"); } } catch(Exception
unable to get value returned from javascript variable in page
")) { response.sendRedirect("SuccessAdmin.jsp"); } if(uname.equals("sauro")&& pass.equals("sauro")){ response.sendRedirect("Success.jsp"); } } I want
web application security - Security
("user")) { response.sendRedirect("next.jsp"); } For read more
servlet session - JSP-Servlet
as: response.sendRedirect(aboutus.jsp) instead i want a general code which redirect you to a page
java - JSP-Servlet
",userName); response.sendRedirect("welcome.jsp"); } if(rs.getInt...); session.setAttribute("userid",userName); response.sendRedirect("welcome.jsp...); response.sendRedirect("register.jsp"); } if(rs.getInt("logincount")==10
question
question  i am using this code in my project response.sendRedirect("LoginForm1.jsp?msg=Username or Password is incorrect!"); but i wan't to hide this message from url.please help me. you gave me the response Hi Jamsiya
unable to validate username and password from ms acess database
){ out.println("welcome " +user); } else{ response.sendRedirect
unable to validate username and password from ms acess database
){ out.println("welcome " +user); } else{ response.sendRedirect
unable to validate username and password from ms acess database
{ response.sendRedirect("login.html"); } } catch(Exception e
unable to validate username and password from ms acess database
{ response.sendRedirect("login.html"); } } catch(Exception e
Using Servlets, JSP for Online Shopping
")) { response.sendRedirect("adminPage.jsp"); } else { response.sendRedirect("viewCart.jsp"); } } else { response.sendRedirect("Login.jsp"); System.out.println("<h1
java
) { response.sendRedirect("welcome.jsp"); } else { response.sendRedirect("login.jsp... { response.sendRedirect("login.jsp"); } System.out.println("Connected
question
) { response.sendRedirect("AdminForm.jsp"); } else { response.sendRedirect("EmpForm.jsp... { response.sendRedirect("login.jsp?msg=Username or Password is incorrect
jdbc - JDBC
++; // response.sendRedirect("login.jsp"); } out.println(count); Count is result of total
SendRedirect()
SendRedirect()  What is the difference between sendRedirect() and forward()?   Response.sendRedirect (): This function is used, when we want to redirect the client request to some other site (i.e out of our context
How to disable browser back after logout - JSP-Servlet
= removeactiveUser.deleteCosmosActiveUser(empId); response.sendRedirect("../index.jsp"); my
ajax using jsp
"); //response.sendRedirect("index1.html"); } catch (Exception e) { out.println(e
JSP SQL Error
()){ String redirectURL= "New.html"; response.sendRedirect
How to use filter to redirect to login page after session timeout
); } else { response.sendRedirect("/login.jsp
how to retrieve text and images from mysql database and show on html page using jsp servlet
("LOGIN SUCCESS, WELCOME ADMIN"); else { response.sendRedirect("login2.html
JSP - JSP-Servlet
()) response.sendRedirect("Registers.jsp"); else { PreparedStatement ps... successfully Registered"); else response.sendRedirect("Registers.jsp
jsp - JSP-Servlet
) { session.setAttribute("userid",userName); response.sendRedirect("welcome.jsp"); } else { response.sendRedirect

Ads