This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HF Final Mock Q 56 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HF Final Mock Q 56" Watch "HF Final Mock Q 56" New topic
Author

HF Final Mock Q 56

Ranjit Jana
Ranch Hand

Joined: Feb 17, 2005
Posts: 30
Hi ,

Q 56 Given :

10. public void doGet(HttpServletRequest req ,
11. HttpServletResponse)
12. throws IOException , ServletException {
13. RequestDispatcher rd1
14. = getServletContext.getRequestDispatcher("/xyz");
15. RequestDispatcher rd2
16. = req.getRequestDispatcher("/xyz");
17. RequestDispatcher rd3
18. = getServletContext().getRequestDispatcher("xyz");
19. RequestDispatcher rd4
20. = req.getRequestDispatcher("xyz");
21. }


answer

C(marked ) rd2.forward(req , res) and rd4.forward(req , res ) may forward to same resource.
------------------
I disagree as one is relative URL to present resource another relative to context( starting with /) so option c is may not be correct in all the situation.

Please post your comment on this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HF Final Mock Q 56
 
Similar Threads
to do a forward in servelt
forward() and sendRedirect()
Problem with RequestDispatcher
Which kind(POST/GET) of request is used for JSp
RequestDispatcher