Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-18-2008, 06:09 AM
Member
 
Join Date: Oct 2008
Location: Bangalore
Posts: 2
Rep Power: 0
sanat kumar meher is on a distinguished road
Default how to pass multiple values through hyperlink to a jsp page ?
Hi friends,

i want to pass values through diffrent hyperlink.The scenario is like this.
I have a tabular data with checkbox corresponding to each row.When i ll select the checkboxes,then those values shouldbe displayed on the same page and the corresponding hyperlink is also there through the same value.I have used iterator to pass multiple values,but the selected checkbox values are not being displayed because iterator.next is not working multiple times.
can anybody guide me how to display multiple values and also pass values through that hyperlink..

The code for the same is here :

code:
--------------------------------------------------------------------------------

<body>
<div align="center"><u><strong>INDEXER PAGE</strong></u></div><form id="form1" name="form1" method="post" action="indexer.jsp"> <p> INDEXING LIST</p>
<% Connection conn=null;try{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/trackingsystem","root","root");
} catch(SQLException e) {
System.out.println("SQLException: " + e.getMessage());
while((e = e.getNextException()) != null)
System.out.println(e.getMessage());
} catch(ClassNotFoundException e) {
System.out.println("ClassNotFoundException: " + e.getMessage()); } ResultSet rs=null;
Statement stmt = conn.createStatement(); // sql query to retrieve values from the secified table.
String QueryString = "SELECT * from indexinfo";
rs = stmt.executeQuery(QueryString);%>
<table cellpadding="15" border="3" style="background-color: #ffffcc;"> <tr> <td><b>BATCH</b></td>
<td width="145"><b>SCANED DATE(YYYY-MM-DD)</b></td>
<td width="140"><b>DUE DATE</td>
<td width="167"><b>INDEX DATE</td>
<td width="228"><b>TOTAL NO OF PAGES</td> </tr>
<% while (rs.next()) { %>
<tr> <td><input type="checkbox" name="batch" value= "<%=rs.getString("batch")%>" /><%=rs.getString("batch")%></td>
<td><%=rs.getDate("scandate")%></td>
<td><%=rs.getDate("duedate")%></td>
<td><%=rs.getDate("indexdate")%></td>
<td><%=rs.getInt("totalpages")%></td>
</tr> <% }
rs.close();
stmt.close();
conn.close();
%> </table>
<p>
<input type="submit" name="button" id="button" value="SUBMIT" />
</p> <p> </form>
<form id="form2" name="form2" method="post" action="">
<% ArrayList items=new ArrayList();
String[] itemselected; String itemname; itemselected=request.getParameterValues("batch");
if(itemselected!=null){
for(int i=0;i<itemselected.length;i++){ itemname=itemselected[i];
items.add(itemname);
} }
Iterator iterator=items.iterator();
out.println("<u><b> The batches that u selected: </b></u>");
out.println("<u><b> Click on any batch you want to index </b></u>"); // while(iterator.hasNext()){
/ out.println("<p>" +iterator.next()+ "</p>");
// } while(iterator.hasNext()){
out.println( "<p><a href=\"indexing_inprocess.jsp?value=" +iterator.next()+"\"> </p>" );
out.println("</a>");
} %>


<p> </p> </body>

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



thanks,
Sanat

Last edited by sanat kumar meher; 11-18-2008 at 06:14 AM.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Language in my web page Albert JavaServer Pages (JSP) and JSTL 3 09-21-2009 02:46 PM
passing values from main page to pop up window vicky JavaServer Pages (JSP) and JSTL 4 12-29-2008 04:06 PM
How to pass mysql string through a url parameter to a detail page query kwesiaryee New To Java 1 08-22-2008 07:28 PM
To highlight multiple selected values in listbox swapnanair JavaServer Pages (JSP) and JSTL 1 05-06-2008 12:17 PM
have to make the bookisbn column values as hyperlink to a page name bookinfo.jsp whi koushika New To Java 0 04-01-2008 05:14 PM


All times are GMT +2. The time now is 09:25 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org