It's not a secret anymore!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HF Final Mock Q27 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HF Final Mock Q27" Watch "HF Final Mock Q27" New topic

HF Final Mock Q27

Ranjit Jana
Ranch Hand

Joined: Feb 17, 2005
Posts: 30
Page no 813.

The question says Redirect Http Request.

That means same request should be forwarded to next URL.

It is only possible to forward the same request by using Option D

Option A and C will create new Request Objects.

Await your response.

Question @7 How would you redirect an HTTP request to another URL ?
(choose all that apply)

A(marked) response.sendRedirect("/anotherUrl");

D(not marked)
RequestDispatcher dispatcher = request.getRequestDispatcher("\anotherURL");
dispatcher.forward(request, response);

I better frame it in this way what does the redirect Http request actually mean.
Francois Roland
Ranch Hand

Joined: Jul 24, 2003
Posts: 34

Probably the author of this question was referring to the HTTP request as the user sending an HTTP request to the application server. I think that you refer to the HttpServletRequest instance that is created whenever an application server receives an HTTP request.

Looking at all the questions I've already seen in mock exams, the term 'redirect' is always opposed to 'forward'.

Redirect means that the application server sends a response to the client with instructions to ask for a new URL location. Forward means that your servlet (or JSP, which is a servlet anyway) asks another resource to complete the request processing.

Forward is always hidden from the client, redirect is never.

Brown belt on
muthulingam Jayakanthan
Ranch Hand

Joined: Feb 27, 2005
Posts: 43
Please help me to get this mock exam resource, and What you mena by page number and which book u are referring. Are there any e copy to refer the pages and mock exam
Ranjit Jana
Ranch Hand

Joined: Feb 17, 2005
Posts: 30
HF means Head First Jsps and servlets
Consider Paul's rocket mass heater.
subject: HF Final Mock Q27
It's not a secret anymore!