Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Question from Anand Chawla's Mock Exam

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Linda,
Thanks a bunch!
Regards
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agreed with Roy, A and C r correct.
A path may or may not be relative.
- Dharmin
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Venu.
I am sorry; I should have seen the JavaRanch link before asking you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic