[Logo]
Forums Register Login
Return object from servlet to jsp
Can someone tell me how to return a object from the servlet to the jsp page? Any sample codes for servlet and jsp portions?

Newbie here.
Welcome to the JavaRanch! Please adjust your displayed name to meet
the <BR>JavaRanch
Naming Policy
. <BR>You can change it here.<BR><BR>Thanks!
and welcome to the JavaRanch!
The usual way of allowing servlets and JSP to share objects is by attaching the object to either a HttpSession or the ServletContext. It depends on whether the object contains data specific to a particular user or if it is more general.
NOTE: you can only share objects this way between servlets and JSP in the same "web application."
The methods are all in the servlet API - you should have a copy if you are going to be serious about servlets.
Bill
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database


This thread has been viewed 1685 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 20, 2019 18:55:25.