• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from Anand Chawla's Mock Exam

 
SRV Gopal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can anyone help me out on this one?
Which of the following are true wrt sendRedirect method of HttpServletResponse?
A. Sets the Location Header
B. Path can be only relative
C. To support clients w/o redirect capability, method writes a short response body that contains a hyperlink to the new location
D. Must be called after response is committed else throws IllegalStateException
Select any two.

Thanks in advance.
 
Linda Xu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer should be A and B.
C is unnecessary. D is exactly the wrong answer, redirect should happen BEFORE the response is committed
 
SRV Gopal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Linda,
Thanks a bunch!
Regards
 
Raji Ram
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Venu,
Is this Anand Chawla's mock exam a free version? if so, can you please post the link to it?
Thanks in advance,
Raji.
 
Roy Cantos
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Linda Xu:
The answer should be A and B.
C is unnecessary. D is exactly the wrong answer, redirect should happen BEFORE the response is committed


Hi Linda,
I think the answer should be A and C.
B is incorrect the path can be absolute and relative
C is correct, when the browser w/o redirect capability, method writes a short response body that contains a hyperlink to the new location.
Best Regards,
Roy
[ January 28, 2003: Message edited by: Roy Cantos ]
 
Dharmin Desai
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agreed with Roy, A and C r correct.
A path may or may not be relative.
- Dharmin
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact, A & C are the correct answers.Read the specs more carefully.
 
SRV Gopal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raji,
Here's the link:
JavaRanch SCWCD Links
Regards
 
Raji Ram
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Venu.
I am sorry; I should have seen the JavaRanch link before asking you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic