1

In spring i have a code to redirect onto jsp paje:

<error-page>
        <error-code>404</error-code>
        <location>404.jsp</location>
    </error-page>

But when i try to use html page with

<location>/WEB-INF/templates/404</location>

or

<location>/WEB-INF/templates/404.html</location>

it shows me 404 standart error, not mine error page.

  • Use a exception handler. Look at the following post. http://stackoverflow.com/questions/21061638/spring-mvc-how-to-return-custom-404-errorpages – Avinash Nov 28 '16 at 15:46

1 Answers1

0

can you try the following code and let me know if this worked for you

<error-page>
    <error-code>404</error-code>
    <location>/404</location>
</error-page>

or

<error-page>
    <error-code>404</error-code>
    <location>/404.html</location>
</error-page>
Periklis Douvitsas
  • 2,431
  • 1
  • 13
  • 14