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

404 when the id is not found is not working #13

Open
lucascs opened this issue Apr 12, 2014 · 6 comments
Open

404 when the id is not found is not working #13

lucascs opened this issue Apr 12, 2014 · 6 comments
Labels

Comments

@lucascs
Copy link
Member

lucascs commented Apr 12, 2014

Since ParameterLoader is now an Observer, it can't stop the interceptor stack.

So, if the id is not found on database, even if result.notFound() is called, the controller method will also be called. =/

Maybe we should change ParameterLoader to be an Interceptor again, and use methodInfo to set the parameter directly.

@garcia-jj
Copy link
Member

Hmm, @Turini what you think?

@Turini
Copy link
Member

Turini commented Aug 27, 2014

hum, I think return to an interceptor would be the simpler option here.

@garcia-jj
Copy link
Member

I'm thinking about this issue... and I was always opposed to throws an not found when an entity is not found. I think that is a decision that application knows, and not the framework.

What you think to change this behavior to same as JPA says: if an entity is not found, only returns null. So the application can decide if will throws an Exception, or a not found page, or another approach.

@lucascs
Copy link
Member Author

lucascs commented Sep 4, 2014

If the id is on the URL and the entity is not found, it's a 404. We shouldn't return null to the user.

@Turini
Copy link
Member

Turini commented Sep 4, 2014

I agree with Lucas' comment. It's a 404

@rafaelGuerreiro
Copy link
Contributor

Guys, could you, please, re-validate the PR #31? Should I add docs about it?

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

No branches or pull requests

4 participants