This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes how to get objects from an included Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to get objects from an included" Watch "how to get objects from an included" New topic
Author

how to get objects from an included

Donna Reschke
Greenhorn

Joined: Jun 20, 2001
Posts: 17
i have a jsp that needs objects wich are generated in a servlet.
i need to include this servlet in the jsp and need to be able to get objects from the
servlet.
how can this be done?
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
You set the objects as attributes in the HttpServletRequest object and access them in the JSP.
//servlet code
request.setAttribute("objectName", new Object());
//jsp code
Object obj = request.getAttribute("objectName");
 
wood burning stoves
 
subject: how to get objects from an included