File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how do you display the struts forward to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how do you display the struts forward to jsp" Watch "how do you display the struts forward to jsp" New topic
Author

how do you display the struts forward to jsp

leo oke
Greenhorn

Joined: Jul 09, 2007
Posts: 21
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

Joined: Feb 15, 2005
Posts: 4864
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?


Merrill
Consultant, Sima Solutions
leo oke
Greenhorn

Joined: Jul 09, 2007
Posts: 21
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?
 
wood burning stoves
 
subject: how do you display the struts forward to jsp