• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sendError(int) vs setStatus(int)

 
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 guyz,

to me both sendError(int) and setStatus(int) appear to do the same things. Is there any diff b/w in view of what client sees on the browser.

thankz,
puneet
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In case of sendError method the container built a error page and sent to the browser ( Some browser may take there own action). In case of setStatus the container sent only code and the browser take appropriate action, that is, the default container error machanism is not clalled.

But if you define the <error-page> for particular code, then the page is called in case for both the method.

The sendError one extra overloaded version which take Status code and message string as argument.

Hope this help

Thanks
 
Puneet Vashisht
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankz dude, its very much clear now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic