This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how do you display the struts forward to jsp

 
Posts: 21
  • 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");

}
}
 
pioneer
Posts: 4864
  • 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
Posts: 21
  • 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?
 
My cellmate was this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!