0

Im using mojarra 2.1.3, primefaces 3.2, netbeans 7.0.1.

When we navigate to the outcome xhtml in this ViewScoped managed bean method, is the outcome xhtml loaded via HTTP GET or HTTP POST?

    public String saveAll() {
    try {
        processPrincipalDistributorDealers();
        int res = saCompanyFacade.addCompany(sacompany, sacontacts, sacompanyproductallocations, saprincipaldistributordealers);
        if (res == 0) {
            return "/users/viewCompanies?faces-redirect=true";
        } else {
        .....

If this is POST I'd have problem with browser back button, if not then it's fine.

Please help. Thanks.

frazkok
  • 49
  • 1
  • 2
  • 11

1 Answers1

1

When returning a normal outcome

return "outcome";

then it won't change the current request method which is always POST in case of JSF UICommand actions.

When returning a redirect outcome

return "outcome?faces-redirect=true";

then it basically instructs the webbrowser to send a new GET request on the outcome. You also see the new URL being reflected back in the browser's address bar. This is always GET.

You can also easily track it down by checking the HTTP traffic in the webbrowser's developer toolset (press F12 in Chrome/IE9/Firebug and check "Net" or "Network" section to see it).

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hi @BalusC could you help with this question http://stackoverflow.com/questions/11553933/jsf2-0-state-saving-method-client-issues – frazkok Jul 21 '12 at 13:35