Originally posted by ordin sword:
I got a question about servlet. Can anyone tell me if i can pass an object from a servelt to jsp.
My intention is:
1. use a method from EJB in servlet and get a 'Collection' of object.
2. pass this object to jsp file for displaying.
In the Servlet,
and in the jsp
Object x = request.getAttribute("name");
but i would not recommend that coz u have no control over the size of your Collection. I don't know what u are querying the DB for in the bean but if there are something more than 10-20 K elements in the collection, then please use a serializable custom class that u populate in the servlet and access in the jsp. I guess that would be a more robust and scalable solution.