• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet to JSP communication

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI
Is there any one who has solved problem of communicating info from servlet to jsp.
Cheers
Sanjay
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whats it that you would like to know?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on the detail of your application, you can probably use the session object.
G.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic