jsf - JavaServer faces redirecting form -
hello have form:
<h:form> <h:selectoneradio layout="pagedirection" value="#{votesbean.answer}"> <f:converter converterid="pollconverter"/> <f:selectitems value="#{pollsbean.selectitems}"/> </h:selectoneradio> <h:messages/> <h:commandbutton value="#{msgs.vote}" action="/profile/main.xhtml"/> </h:form>
but when submit form, page no redirects main.xhtml, refresh current page (viewpoll.xhtml, ‘think because there errors in form), not include view parameters. use view parameter know current poll… in result nullpointer exception, because don’t have poll id.
- if navigate directly without validation , conversion, use
immediate="true"
inh:commandbutton
. - otherwise, there might failure in
request processing life cycle
, eg.validation phase
. - finally,
url
(/profile/main.xhtml) address incorrect.
Comments
Post a Comment