This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HF Final Mock Q 56  RSS feed

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. }


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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!