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" in h:commandbutton.
  • otherwise, there might failure in request processing life cycle, eg. validation phase.
  • finally, url(/profile/main.xhtml) address incorrect.

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -