aspose file tools*
The moose likes Servlets and the fly likes Servlet to JSP communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet to JSP communication" Watch "Servlet to JSP communication" New topic
Author

Servlet to JSP communication

Sanjay, Lalwani
Greenhorn

Joined: Jun 05, 2001
Posts: 4
HI
Is there any one who has solved problem of communicating info from servlet to jsp.
Cheers
Sanjay
Poornima Shetty
Greenhorn

Joined: Dec 12, 2000
Posts: 26
Whats it that you would like to know?
Glenn Proctor
Greenhorn

Joined: Jun 07, 2001
Posts: 1
Depending on the detail of your application, you can probably use the session object.
G.
vikinsa
Ranch Hand

Joined: Apr 18, 2001
Posts: 46
There is not much diffrenece in what you do for servlet-servlet communication and the servlet-jsp communication. Only thing you need to consider is the path and the port.
Originally posted by Sanjay, Lalwani:
HI
Is there any one who has solved problem of communicating info from servlet to jsp.
Cheers
Sanjay


------------------
Vikas Aggarwal
Technology Associate
http://www.vikinsa.com


Vikas Aggarwal<BR>Technology Associate<BR>http://www.vikinsa.com
Melissa Rabin
Greenhorn

Joined: May 30, 2001
Posts: 3
Struggling with this a few weeks ago myself (being the greenhorn of servlets that I am), i learned that there are several tasks involved in communicating jsp info to a servlet:
1. Access web data through the request object of a servlet. Strings can be retrieved through get/setParameter, and objects via get/setAttribute(). Add/manipulate them via your session context object when in the servlet doPost method.
2. Don't forget, if you use servlets in your web apps you need to provide a declaration and mapping for them in your web deployment descriptor (your web.xml). This is a twofold task of declaring the servlet (and its class package) in the <servlet> element, and mapping the servlet to a url pattern (i.e. the initiating jsp) in the <servlet-mapping> element. Your web app container should provide ample info on the details.
3. Include the tag
<form name = "ServletName" action="/ServletName" method = "POST">
and you will be ready to go!
Hope this helps!
Melissa
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet to JSP communication