This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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

How to identify a particular selected record in struts?

Vino Guruswamy

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"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Search Results</title>
<script language="javascript">
function backtoSearch()

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

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


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

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

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

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

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


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

I agree. Here's the link:
subject: How to identify a particular selected record in struts?
It's not a secret anymore!