Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 2nd, 2009, 05:15 AM
Registered User
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to retrieve the data(ArrayList) from JSP to Action Class

Hi Everyone,

Can somebody guide me how to retrieve my data with Arraylist and pass to my Action Class.

Here's the portion of my JSP code:

<logic:notEmpty name="dbRecordList" >
<logic:iterate id="list" name="dbRecordList">
<tr valign="top" >
<td width="80"><html:text name="payrollDetailForm" property="trnx_code"/></td>
<td width="80"><html:text name="list" property="employee_id"/></td>
<td width="80"><html:text name="list" property="sipc_company_code"/></td>
<td width="80"><bean:write name="list" property="lastname"/></td>
<td width="80"><bean:write name="list" property="firstname"/></td>
<td width="80"><bean:write name="list" property="mi"/></td>
<td width="100"><html:text name="payrollDetailForm" property="date_fr"/></td>
<td width="70"><html:text name="payrollDetailForm" property="date_to"/></td>
<td width="70"><html:text name="payrollDetailForm" property="ee_amount"/></td>

</tr>
<br class="clear"/>
</logic:iterate>
</logic:notEmpty>


Here's my Action Class:

/**
*
*/
package spcpayroll.trans.action;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import spchrm.dao.PIMBean;
import spcpayroll.dao.PayrollDetailDAO;
import spcpayroll.trans.form.PayrollDetailForm;

/**
* @author JMBalisacan
*
*/
public class PayDetailAddAction extends Action {

/* (non-Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache .struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
ActionForward returnForward = null;

//Cast the form object argument to the
// action form corresponding to this class.
PayrollDetailForm f = (PayrollDetailForm)form;

//Instantiate the UserMaintDAO class for connecting to the DB.
PayrollDetailDAO payrollDetailDAO = new PayrollDetailDAO();

//ArrayList dbRecordList = (ArrayList)request.getSession(true).getAttribute(" dbRecordList");
ArrayList dbRecordList = (ArrayList)request.getSession(true).getAttribute(" dbRecordList");

for (int i = 0; i < dbRecordList.size(); i++) {



}


return mapping.findForward("success");
}

}


Any help is greatly appreciated.

Thanks

CESAR
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jsp:useBean and ArrayList IronStar JSP Basics 1 October 30th, 2008 04:32 AM
Cannot retrieve mapping for action /next(STRTUS) msg2ajay Struts 1 July 19th, 2007 01:36 AM
How to display errors from Action class on the jsp ntando HTML Code Clinic 0 December 5th, 2006 06:30 PM
arraylist need to store data from jsp kotaiah JSP Basics 0 October 14th, 2006 01:57 AM
Retrieve Data from Java Bean to JSP page Nirav Joshi JSP Basics 1 August 24th, 2005 07:45 AM



All times are GMT -4. The time now is 04:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.