• 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

Doubts regarding request and response objects.

 
Ranch Hand
Posts: 59
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Iam having some confusions..

Iam having these to servlets, what iam doing is to try to include the output of another servlet into my servlet.
FirstServlet : In which the output of SecondServlet is to be included.

FIRST SERVLET




SECOND SERVLET




Doubts:

1. what do the request and response objects contain in the rd.include(request,response); i tried request.toString() and response.toString(). though am sure that request is obviously the GET request for the first servlet but dont know what the response object contains.
2.Iam not able to understand the way we sent request parameters. like " ?myname=aashima",i mean it is the path ,so can we just pass the information as a
query string appended to the destination URL.
3.and am sorry about the weirdest confusion. what does the response.setContentType("text/html") do. i mean in the second servlet when we write
out.println(attribute+ ":" + request.getAttribute(attribute)+"<BR>"); we have no opening tags (out.println("<html">) and likewise no closing tags. so we can use it this way?


i have just started the preparation so my basics are not clear but am trying. would be great if you guys help

 
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Aashima, you don't use Servlets in the OCMJD - maybe you meant to post in another forum? The guys in this forum here might be better positioned to help you Web Component Certification (SCWCD/OCPJWCD).
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sean Keane wrote:Hi Aashima, you don't use Servlets in the OCMJD - maybe you meant to post in another forum?



Absolutely! Let's slide this over to the Servlets forum!
 
Aashima Arora
Ranch Hand
Posts: 59
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh iam very sorry ...
 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic