File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes JSP+Checkbox - Urgent !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP+Checkbox - Urgent !!" Watch "JSP+Checkbox - Urgent !!" New topic

JSP+Checkbox - Urgent !!

Rama moorthy

Joined: May 18, 2001
Posts: 8
Dear Friends,
I give below my coding.My requirement is as below.
I am generating a table with three columns and one column is having a hyperlink and another 2 columns have checkboxes.
Basically it is for the candidate profile.
So after clicking the hyperlink ,i will get the second page wherein i will get the candidate details.After going thro'the same i will come back to first screen,where against the candidate name i will select the options provided in the two check boxes.I will repeat the procedure for the next candidate.
But the problem is that when i go for the second candidate and view his profile and after coming to the first page ,the status of the first candidates becomes blank and it is not setting back to the original position.
In a nutshell my settings at the checkboxes for the first candidate should not get changed even after going to and from the
first page.
My problem is that i should not use javascript.
My coding:
<%@ page language="java" session="true"%>
<%@ page import="javax.servlet.*,javax.servlet.http.*,java.util.*, java.sql.*,*" %>
<title>New Candidates</title></head>
String req =" ";
String jid =" ";
String cid =" ";
String ca_title =" ";
String status =" ";
String action =" ";
int count = 0;

Connection con;
ResultSet rs;
Statement st;
String sql;

req = request.getParameter("ca_title");

jid = request.getParameter("jid");
status = request.getParameter("status");
action = request.getParameter("action");

cid = request.getParameter("cid");

<input type="hidden" name="ca_title" value="<%=req%>">
<input type="hidden" name="cid" value="<%=cid%>">
<input type="hidden" name="jid" value="<%=jid%>">
<p>New Candidates</p>
<p>Project Managers</p>
<p>(Click name for Profile Summary</p>
<tr><td>Candidate Name </td>
<td>Status </td>

con = DriverManager.getConnection("jdbc dbc:info","shop","shop");
st = con.createStatement();
sql = "select candidateID,CAFirstName from candidate where catitle like '%"+req+"%'";
rs = st.executeQuery(sql);
String aa = rs.getString("candidateID");
String bb = rs.getString("CAFirstName");

<tr><td><a href="http://localhost:8080/infodream/detail.jsp?cand_name=<%=bb.trim()%>&cand_id=<%=aa%>&jid=<%=jid%>&cid=<%=cid%>&ca_title=<%=req%>"><%=bb.tri m()%></td>
<td><SELECT name=status>
<OPTION value="<%=status%>" selected></OPTION>
<OPTION value=S>Selected</OPTION>
<OPTION value=R>Rejected</OPTION>
<td><SELECT name=action>
<OPTION value="<%=action%>" selected></OPTION>
<OPTION value=IWI>I Will Interview</OPTION>
<OPTION value=YS>You Screen</OPTION>
<OPTION value=C>Confirmed</OPTION>

catch(Exception e)
out.println("Exception "+e);
<a href="http://localhost:8080/infodream/scrcandidates.html">Send</a>
<a href="http://localhost:8080/infodream/scrcandidates.html">Back</a>
<a href="http://localhost:8080/infodream/scrcandidates.html">Menu</a>

Please give your feedback.
NR Gopinath

Joined: Jul 25, 2001
Posts: 9
After seeing or entering candidate details thro' hyper link, are u reloading the page or simply coming back? if u reload the first page(page contains hyperlink and check box), then already checked boxes will come as empty.if u use javascript(history.back), then pervious information won't lost..
Rama moorthy

Joined: May 18, 2001
Posts: 8
Dear Gopi,
Thanks for your reply.
As mentioned I CAN NOT USE JAVASCRIPT .Also i hv to reload the page.Can u explain any possibility of coming back to first page keeping the same status?
I agree. Here's the link:
subject: JSP+Checkbox - Urgent !!
It's not a secret anymore!