0

I'm trying to set up common "Error page" in my spring mvc app.

It is working fine when happened 404 error with the following setup but the "/app/404.do" is keep being called when the other normal URL link is clicked..

I used tiles framework but the error pages is a just JSP file.

Can you please advise on this?

web.xml

 <error-page>
     <error-code>404</error-code>
     <location>/app/404.do</location>           
 </error-page>

spring

    @RequestMapping(value = "/app/404.do")
    public ModelAndView pageError404(HttpServletRequest request, Model   model) {

    logger.info("page error code 404");
    pageErrorLog(request);
    model.addAttribute("errorMsg", "There is no page you requested.");

    return new ModelAndView("error/error", "model", model);
   }

JSP

    <div align="center">
        <c:out value='${errorMsg}' />
    </div>
JoonHo Kim
  • 31
  • 4

0 Answers0