Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes How to identify a particular selected record in struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to identify a particular selected record in struts?" Watch "How to identify a particular selected record in struts?" New topic
Author

How to identify a particular selected record in struts?

Vino Guruswamy
Greenhorn

Joined: Jun 22, 2009
Posts: 1
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>
 
wood burning stoves
 
subject: How to identify a particular selected record in struts?
 
Similar Threads
Jsp and database using the logic:iterate tag
doesnt display struts tags in normal html form
Problem in SessionManagement in Struts
JspTranslate: End of content reached while more parsing required: tag nesting error?.
how do i use checkbox as an active/inactive button for a form?