Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with custom 404 page mapping #577

Open
gutomarzagao opened this issue Oct 10, 2013 · 2 comments
Open

Problem with custom 404 page mapping #577

gutomarzagao opened this issue Oct 10, 2013 · 2 comments

Comments

@gutomarzagao
Copy link

In order to create a custom 404 page I made the following mapping inside web.xml:

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

My goal was to have the /404 route treated by some controller. Unfortunately, this mapping causes a NullPointerException.

After some research I figure out that the problem is that the /404 request fired by the ERROR dispatcher is beeing missed along VRaptor code.

You can check the problem inspecting RequestInfo instance located at VRaptor class and RequestInfo instance located at DefaultResourceTranslator class. Usually they are the same instance with the same id. But when handling 404 error mapping URL, these 2 instances are different from each other.

@garcia-jj
Copy link
Member

I that we can mapping dispatcher to ERROR too. There are no problems to use this dispatchers.

@lucascs What you think?

May be affects vraptor4.

@lucascs
Copy link
Member

lucascs commented Feb 20, 2014

There is some issue when you add the ERROR dispatcher on VRaptor, I don't remember which issue. But it doesn't work directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants