Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Question from Anand Chawla's Mock Exam

 
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.
 
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
 
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.
 
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 ]
 
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
 
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.
 
Quick! Before anybody notices! Cover it up with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic