• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do you display the struts forward to jsp

 
leo oke
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've an action class and I want to display the forward success to a jsp page,that is the :userlist
I've heard about java beans ,but not sure on it,so how is it done any method?
any help is welcomed?

part code

action class

*/
public ArrayList userList = new ArrayList();




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

HttpSession session = request.getSession();

//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();

request.setAttribute(SUCCESS, userList);


return mapping.findForward("success");

}
}
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I'm not able to understand your question. Could you rephrase the question, or provide more detail as to what you're trying to do?
 
leo oke
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do a struts database,so in my logic class I've created a query
to select the userlist.
Then created action class to forward the output from the logic class.
But I need to know how to display my userlist to the jsp?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic