aspose file tools*
The moose likes JSP and the fly likes Display struts output to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Display struts output to jsp" Watch "Display struts output to jsp" New topic
Author

Display struts output to jsp

leo oke
Greenhorn

Joined: Jul 09, 2007
Posts: 21
I am trying to display userList from my struts action to jsp page,what's the code to do it using java beans or something simple?

part code:
action class
------------------------------------------------------------------------------------------------------------------------
public ArrayList userList = new ArrayList();


public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {


//get connection from database
javax.sql.DataSource dataSource;
java.sql.Connection myConnection = null;



// Here the method that connects to the datasource is called:
dataSource = getDataSource(request);
myConnection = dataSource.getConnection();

UserDAO dao = DAOFactory.createUserDAO(myConnection);
userList = dao.getUser();
HttpSession session = request.getSession();

// extract data
if(userList !=null){

//code here
return mapping.findForward("success");
}else{
return mapping.findForward("fail");
}



}
 
wood burning stoves
 
subject: Display struts output to jsp