Pega Interview Question for Applications Developers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

SendRedirect actually sends a response and status code back to the client, in which case the browser makes another request, hence, the original request object is lost. Forwarding actually passes on the same request.

- Pankaj Singh June 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

thank you

- jaffar June 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

SendRedirect () method is declared in HttpServletResponse Interface as
void sendRedirect(String url)

Redirect sends a header back to the client browser on transfer of control to a different server or domain. Header contains the resource url , the browser needs for redirection. Using this url information, the browser now initiates a new connection and in this process, the old connection and response object are lost.

Forward method is declared in RequestDispatcher Interface as forward(ServletRequest request, ServletResponse response)

Transfer of control is done internally, hence browser/ client in not involved. Request is forwarded to resources available within the same server where the request is made. On forward, the original request and response objects are transferred to the resource along with any parameters available.

Also, in forward the browser does not display the forwarded address in the address bar as it is done internally in the same server while in redirect, the redirected address is visible in the address bar.

Hence, redirect can be used when resource is in different domain/ server, otherwise forward is faster than redirect.

- Sailaja Vellanki June 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

thank you

- jaffar June 22, 2012 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More