Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3273

@Startup + @Create on session-scoped bean broken in Seam 2.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 2.1.0.CR1
    • Component/s: None
    • Labels:
      None
    • Environment:

      clean Tomcat 6.0.16, Seam 2.1 build 281

      Description

      In 1.x, 2.x and Seam 2.1 build from ~march 2008 it was possible to access, for example, cookies info or other http request attributes at session creation time. It was extremely useful to fetch f.e. user-specific data from database to create custom view etc, (described f.e. here http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963032). It is not working anymore. Both FacesContext.getCurrentInstance() and ServletContexts.getInstance().getRequest() now return null within @Create method.

      @Name("sessionStateBacker")
      @Scope(ScopeType.SESSION)
      @Startup
      public class UserStateBacker
      implements Serializable
      {
      @Create
      public void sessionCreated()
      {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      if (facesContext == null)

      { System.out.println("FacesContext is null in 2.1.0 but worked fine in 2.0.3"); }

      //facesContext.getExternalContext().getRequestCookieMap();
      }
      }

        Gliffy Diagrams

          Attachments

          1. issueDemo.war
            9.44 MB
          2. src.zip
            2 kB

            Issue Links

              Activity

                People

                • Assignee:
                  shane.bryzak Shane Bryzak
                  Reporter:
                  przemjaskier Przemyslaw Jaskierski
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: