Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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


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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.