JSF Tip #33 - Stateless JSF

In a previous blog entry I blogged about stateless JSF before, this time I will include the entire page so you can see how silly simple it actually is. And you can also go directly to Subversion to get the sample there.

The entirely stateless page

    <?xml version='1.0' encoding='UTF-8'?>

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml"
        <f:view transient="true">
                        This is completely (view-)stateless.
                    <h:commandButton value="Submit"/>

As you can see you can use a form and a commandButton. It will still do a post back it just will not cache the Facelets page so it will rebuild it every time.

Posted November 6, 2013