Yes, the JSF lifecycle is request-bound. And yes, the outcome will by default render in the same request.
The key which is confusing you is likely "forward" versus "redirect" in terms of HTTP servlet requests.
JSF by default forwards the request to the target page. If you know the Servlet API well, you'll understand that it is then under the hoods doing the following:
request.getRequestDispatcher("welcome.xhtml").forward(request, response);
This way the target page has access to the same request object. If the target page is different from the page where the form is been submitted to (the login.xhtml
actually), then you won't see the change being reflected in the browser address bar.
You can however configure JSF to redirect the request to the target page by adding a <redirect/>
to the navigation case, or by calling ExternalContext#redirect()
in bean's action method, or in a nice JSF 2.0 way by adding faces-redirect=true
parameter to the button's action:
<h:commandButton value="login" action="welcome?faces-redirect=true" />
Either way, it is in Servlet API terms doing the following:
response.sendRedirect("welcome.xhtml");
which basically instructs the client to fire a brand new GET request to the given location. Note that this way any request- and view scoped beans of the initial request will be trashed and recreated.