2

I have ExeptionServlet that catches the exceptions and displays the information what I need.

I point out in web.xml

<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/exception</location>
</error-page>

<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/exception</location>
</error-page>

How to do without web.xml and Spring?

Philippe Marschall
  • 4,452
  • 1
  • 34
  • 52
GoodWin
  • 150
  • 10
  • 2
    If you are using Servlets 3.0, than I'm afraid web.xml is required for defining error-page: [How to define and in servlet 3.0's web.xml-less?](https://stackoverflow.com/a/13450154/5267892). If you decide to use Spring Framework, you can do it as showed here: [Servlet 3.0 without web.xml error-page javaconfig](https://stackoverflow.com/a/39440659/5267892) – Lennier Jan 19 '18 at 08:18

0 Answers0