2
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 web.xml, when the user enters an unknown link or leads to one of these errors, to be redirected to the Controller, to handle the page inside the Controller itself.
The corresponding jsp pages are already created, inside the error folder, as requested by Vraptor, using Tomcat or Glassfish, the page is empty.
Do you need to redirect to each specific Controller? has tried using result.forwardTo(); ?
– Wellington Avelino
In fact, I want you to redirect to that controller only, so that it can handle the error-pages.
– Tiago Ferezin
I don’t quite understand this one
tratar
the error pages, it would not be better to add some message on the screen with a button to redirect to the previous page?– Wellington Avelino
That way your @Wellingtonavelino I’m already doing, but it doesn’t show some components on the page, which are loaded on the server, through an Intercept, so I’ll have to go through a controller to trigger the Intercept and I load other components through this controller, and the
tratar
would load these different components on the server, and record an audit, differently for each error, in the database, so I need the Controller.– Tiago Ferezin
I get it, I’m going to read the doc, because a few months ago I stopped using Vraptor
– Wellington Avelino
http://chat.stackexchange.com/rooms/11910/estouro-de-pilha @TiagoFerezin
– Wellington Avelino
@Wellingtonavelino found the solution and posted
– Tiago Ferezin