I have 3 pages:
main.xhtml
agreement.xhtml
generated.xhtml
The agreement.xhtml
needs two parameters to load correctly: serviceId
and site
. So, a normal url looks like this: /app/agreement.xhtml?site=US&serviceId=AABBCC
.
I have this button on agreement.xhtml
<h:form>
<h:commandButton value="Generate License File" action="#{agreement.generateMethod}" />
</h:form>
The @RequestScoped
bean #{agreement}
has this method:
public String generateMethod(){
.......
return "generated";
}
I need that, on click, the generateMethod()
method is executed, and after it's done, the user is redirected to the generated.xhtml
page. What's happening is that, on click, the page browser sends the user to /app/agreement.xhtml
and, since it's not sending the parameters site
and serviceId
, it crashes.
I tried making the generateMethod()
return a "generated?faces-redirect=true"
, but still nothing. Any ideas?