5 Replies Latest reply on Aug 9, 2007 2:10 PM by birwin

    Newbie Help. Do I have SEAM deployed?

    birwin Newbie

      I started fiddling with SEAM (2.0.0BETA1) today, but I don't think I have installed it correctly (Installing on JBoss 4.2.1.GA).

      I am unable to display data in my UI (Its a JSP). Each time I load the web page, the input field is empty, but my backing bean has data. The backing bean has a value assigned to its property on instantiation (See the java code below). If I add a "managed-bean" entry to my faces-config.xml, it works fine and the number appears in my input field. I thought I did not need "managed-bean" entries in my faces-config.xml file if I was using SEAM. From my searches on the Internet, it appears that I am not using SEAM, but the plain JSF. I have deployed the Seam JAR file in the WEB_INF/lib directory of my war file. Attached are my faces-config, web.xml, JSP and Java class files.

      My java class has the Name and Scope annotations, and I have included the phase-listener entry in my faces-config.xml file in addition to including the listener-class entry in my web.xml file. When I deploy to my JBoss server, it appears SEAM kicks in. I see row after row of "INFO [Component] Component: org.jboss.web.session, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.web.Session" type messages.

      Any ideas what I did wrong?

      faces-config.xml file:
      <faces-config>


      <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>

      </faces-config>

      web.xml file:
      <web-app>
      <!-- Listeners -->

      <!-- Seam -->
      <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>


      <!-- JSF -->
      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>


      <!-- Faces Servlet -->

      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>


      <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
      <taglib-location>/WEB-INF/jsf_core.tld</taglib-location>


      <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
      <taglib-location>/WEB-INF/html_basic.tld</taglib-location>


      <taglib-uri>http://java.sun.com/jsp/jstl/core </taglib-uri>
      <taglib-location>/WEB-INF/c.tld</taglib-location>


      </web-app>

      JSP:
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>



      <f:view>
      <h:form>
      <h:inputText value="#{test.text}" />
      </h:form>
      </f:view>



      Test Java Class:
      import org.jboss.seam.ScopeType;

      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;

      @Scope(ScopeType.CONVERSATION)
      @Name("test")
      public class Test
      {
      private String text = "hello";

      public String getText()
      {
      return text;
      }

      public void setText(String text)
      {
      this.text = text;
      }
      }