• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

HttpServletResponse.sendError(): need redirect to error page  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code in doFilter() method, where I get application scoped bean.



I mapped 503 code to specific error page in web.xml. And I really get content of error page in browser, if error occurs. But the address in address bar doesn't change for error page address: an address of requested servlet leaves there. Is it right behaviour?
I'd like to inform explicitly about redirection to error page. Is it only possible with sendRedirect() and sendError() is not useful here?
 
Author and ninkuma
Marshal
Posts: 66826
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would it be important that the URL of the error page be displayed? It's not. That's not the page that was requested. The behavior you are seeing is correct.
 
Davin Austin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I just thought that it is better approach to display error page address.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66826
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? That's not the page that was requested. What advantage would there to be to displaying the URL of an error page?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!