I have the following codes below:
web.xml:
<error-page>
<error-code>404</error-code>
<location>/error/404</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error/500</location>
</error-page>
ErrorController.java:
@Controller
@Resource
public class ErrorController {
public ErrorController(){
}
@Path("/error/404")
public void error404(){
}
@Path("/error/500")
public void error500(){
}
}
I would like the web.xml, when the user enters an unknown link or that leads to one of these errors, be redirected to the Controller, to treat the page within the same Controller.
The respective jsp pages are already created inside the error folder, as requested by VRaptor, using TomCat or GlassFish, the page is left blank.