I've a page that shows an item via its id: item.xhtml?id=xxx
If no id is provided the list of all items is shown.
In the same page there is a form used to update item's fields.
Using <f:viewParam>
and an hidden input I'm able to show item.xhtml?id=xxx
again when I submit the form. But if a validation error occurs (I use Bean Validation) the item.xhtml appears with the list of all items and the error message. Is there a way to redirect even if an error occurs?
PS: why jsf takes away the querystring from urls? I mean that these kind of problems would no exists if the rendered form action was /context/page.xhtml?query=string
instead of just /context/page.xhtml
. Where am I wrong?