jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Read table values in Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Read table values in Action" Watch "Read table values in Action" New topic

Read table values in Action

Kieran O'Callaghan

Joined: Aug 09, 2011
Posts: 2
My application stores information on courses, companies, students and results. Students can be associated to one or more companies.
On the update student page the user has the option to associate or disconsolate companies with a student.

So far I have the full list of companies listed on the update student page along with the correct the Boolean values (associated or not associated).
Also the user and associate or disassociate companies by checking or unchecking a tick box for each of the companies.
The problem I am having is in the Update Student Action, I am not able to read the company details and the boolean values from the table on the update student page.

I do not know how to save this student - company relationship in the Student Form, I have tried saving the values in the session and reading them from there but updates I make on the update student page are not picked up. Also I cannot figure out how to read directly the values on the update student jsp to the update student action.

HELP!!! I am out of ideas!
I hope my explanation is clear.
Here is a code snippet from the update student JSP. I am able to populate the table below from the DB using values I have read in the Get Student Action.

<table border ="1">
<tr><td><b>Company Name</b></td>
<td><b>Company Type</b></td>
<td><b>True or False</b></td>

<c:forEach var="c" items="${companyList}">
<td><cut value="${c.companyName}"/></td>
<td><cut value="${c.companyType}"/></td>
<td><cut value="${c.associatedWithStudent}"/></td>
<c:if test="${c.associatedWithStudent==true}">
<input checked="checked" type="checkbox" name="${c.companyName}" value="${c.companyId}" />
<c:if test="${c.associatedWithStudent==false}">
<input type="checkbox" name="${c.companyName}" value="${c.companyId}"/>

I agree. Here's the link: http://aspose.com/file-tools
subject: Read table values in Action
jQuery in Action, 3rd edition