Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts regarding request and response objects.

 
Aashima Arora
Ranch Hand
Posts: 59
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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

 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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).
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh iam very sorry ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic