• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How to identify a particular selected record in struts?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on an application using Struts in which i want to delete and modify the records displayed from the database in a table.
i have done with displaying the records. but i dont get the details about which record is selected for deletion or modification. I want to get all column values for that particular selected row.

I have attached the source code for the jsp page from which i want to navigate to another page with the details of the selected record. please can anyone help me for this issue.

<%@ page import="java.util.*" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Search Results</title>
</head>
<script language="javascript">
function backtoSearch()
{
window.navigate("/StrutsDispatcher/jsp/SearchDetails.jsp");
}
</script>
<body>

<html:form action="/more" method="post">
<P align="center"> <font size=4> Searching for a particular school.<br> </font> </P>
<br>
<br>
<br>
<table cellspacing =3 cellpadding =6 align ="center" border="1">

<tr>
<th> School Name  </th>
<th> Location   </th>
<th> District  </th>
<th> </th>
<th> </th>

</tr>


<logic:iterate id="list" name="results">
<tr>
<td>
<bean:write name="list" property="scName"/>
<input type="hidden" name="name" value="<bean:write name="list" property="scName"/>"/>
</td>

<td>
<bean:write name="list" property="distName"/>
<input type="hidden" name="location" value="<bean:write name="list" property="distName"/>"/>
</td>

<td>
<bean:write name="list" property="stateCode"/>
<input type="hidden" name="district" value="<bean:write name="list" property="stateCode"/>"/>
</td>

<td>
<html:submit property="options" value="Delete"></html:submit>
</td>

<td>
<html:submit property="options" value="Modify"></html:submit>
</td>

</tr>
</logic:iterate>

</table>
<br>
<br>
<br>
<table align="center">
<tr>
<td> <html:button property="back" onclick="backtoSearch();"> Cancel </html:button> </td> </tr>
</table>
</html:form>


</body>
</html>
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic