users@glassfish.java.net

GlassFish V3 b66 doesn't preserve web session when using deploy on save

From: <glassfish_at_javadesktop.org>
Date: Fri, 09 Oct 2009 20:53:24 PDT

Hi,

I created a Maven web JEE6 app with JSF 2.0. There is a session scoped managed bean, and a facelets page:

package sandbox.jee6web1;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean
@SessionScoped
public class FantasyBean {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:body>
        Hello #{fantasyBean.name}

        <h:form>
            <h:inputText value="#{fantasyBean.name}"/>
            <h:commandButton value="Store"/>
        </h:form>
    </h:body>
</html>

When I run this, I can type a name and press the store button. The page refreshes and displays the name I typed, and also keeps the value in the textbox because of the value binding. If I refresh the page it still shows the name because the data is stored in session.

When I added a new method to the managed bean then saved, NetBeans 6.8 M2 did a deploy on save. When I refreshed the browser, the name was gone. The session was not preserved, and I thought this was a new feature of GlassFish V3?


Thanks,
Ryan
[Message sent by forum member 'rdelaplante' (ryan_at_ijws.com)]

http://forums.java.net/jive/thread.jspa?messageID=367480