hemakiran
response.sendredirect
1 Answer(s)      8 years ago
Posted in : JSP-Servlet

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

Ads

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 ------------------- "/> "/> "/>
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
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
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
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
java - JSP-Servlet
{ response.sendRedirect("/servletApp/myServlet2"); } } response.sendRedirect
send redirect in JSP - JSP-Servlet
the following code: If id = administration { response.sendRedirect..." == ********** response.sendRedirect("backtohome.jsp"); } I want
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
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
Jsp redirect
response.sendRedirect() through which the server sends the response to the client.../"; response.sendRedirect(redirectURL); %> </html>
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
Login Query
))) { response.sendRedirect("/student...))) { response.sendRedirect("/employer..."); response.sendRedirect("index.jsp
I want solution for this jsp program..
"))) { session.setAttribute("username",dbusername); response.sendRedirect("Home.jsp"); } else { response.sendRedirect("Error.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
Clearing session in jsp
"); session.invalidate(); response.sendRedirect("Login.jsp"); %> thanks
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
logout validation - JSP-Servlet
session.invalidate(); response.sendRedirect("../here the path of your home page
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
Radio button validation using jsp - JSP-Servlet
this collect radiobutton value if value is null response.sendredirect("/urjsppage
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
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
servelets - Java Beginners
); } if((user1.equals(user))&&(pass1.equals(pass))){ response.sendRedirect("jsp/welcome.jsp"); } else{ response.sendRedirect("jsp/login.jsp"); } } catch(Exception
Servlet - JSP-Servlet
); response.sendRedirect("welcome.jsp"); } else { response.sendRedirect("user.jsp"); } } catch (Exception e
Servlet & Jsp - Java Interview Questions
"))){ String destination ="./jsp/loginSuccess.jsp"; response.sendRedirect... ="./jsp/error.jsp"; response.sendRedirect(response.encodeRedirectURL
login authentication - Java Beginners
("successfully logged in"); response.sendRedirect..."); response.sendRedirect("HrmsLogin.jsp
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