jsfjsf-2viewexpiredexception

Javax ViewExpiredException thrown upon POST


I try to understand why I get a javax ViewExpiredException on my simple webapp - but I don't seem to understand what is causing the view to expire.

This is the register.jsf:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:b="http://bootsfaces.net/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core" 
      template="pageTemplate.xhtml">

    <ui:define name="content">
<b:panel title="Registrierung" look="primary">
<h:form>
    <h:panelGrid>

        <h:outputText value="Name:"/>
        <b:inputText value="#{registerController.user.name}" placeholder="Robina Kuh"/>

        <h:outputText value="E-Mail:"/>
        <b:inputText value="#{registerController.user.email}" placeholder="robina.kuh@oc.com" size="32">
            <f:facet name="prepend">
                <h:outputText value="@" />
            </f:facet>
        </b:inputText>

        <b:commandButton value="Registrieren" icon="envelope" action="#{registerController.registerUser}"/>
    </h:panelGrid>
</h:form>
</b:panel>
</ui:define>
</ui:composition>

The template:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:b="http://bootsfaces.net/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Lunch</title>
</h:head>
<h:body style="padding: 60px;">
    <ui:include src="topMenu.xhtml" />

    <ui:insert name="content">
        <b:container>
            <b:jumbotron>
                <h1>Da ist wohl etwas schiefgelaufen... Sorry!</h1>
            </b:jumbotron>
        </b:container>
    </ui:insert>
</h:body>
</html>

This is the controller:

@Named("registerController")
@SessionScoped
public class RegisterController implements Serializable {

    @Inject
    private UserManager userManager;
    private User user;

    private Logger logger = Logger.getLogger(RegisterController.class);

    public RegisterController() {
        logger.debug("Created RegisterController");
        user = new User();
        if(user != null)
            logger.debug("Name: " + user.getName()
                    +"\nEmail: " + user.getEmail());

    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String registerUser() {
        logger.debug("registerUser called"
                + "\n Name: " + user.getName()
                +"\nEmail: " + user.getEmail());


        userManager.addUser(user);
        logger.debug("registerUser end");
        return "benutzer.jsf";
    }
}

It even is not entering the action method of my commandButton when I try to debug it (I am using the Bootsfaces Framework but I don't think this has anything to do with that Framework).

Setting the save state to client works but I would like to understand what is the problem? From what I am understanding of JSF this should work without pushing the state to the client side. Am I missing something fundamental?

I deployed the webapp to a widlfly 9 server.


Solution

  • It was a bug in the used wildfly version - just used the new widlfly 10 final release and it is working as it should.