3 Replies Latest reply on Feb 6, 2008 8:40 AM by otembajelle

    Seam managed bean property not set by seam.properties

    otembajelle

      I hardly believe that the mechanism of the seam.properties does not work. So I made a project using Seam-Gen that can easily be reproduced. I would be grateful to know where I am going wrong.

      The project was created using Seam-Gen with the project.type=ear (please note the build.properties below).

      The application can be run using the url ..

      http://localhost:8080/SeamPropertiesIssue/issue.seam

      It shows that the seam.properties name-value-pair <issuebean.value=Value has been set> has no effect. The output is: "Value has not been set".

      The sources are ..
      1. src/action/de/issue/action/IssueBean.java
      2. view/issue.xhtml
      3. resources/seam.properties

      Seam-gen build.properties:

      #Generated by seam setup
      #Mon Jan 07 09:25:19 CET 2008
      hibernate.connection.password=
      workspace.home=C\:/java/jboss-seam-2.0.0.GA/development/
      model.package=de.issue.model
      driver.jar=C\:/java/jboss-seam-2.0.0.GA/seam-gen/lib/hsqldb.jar
      action.package=de.issue.action
      test.package=de.issue.test
      database.type=hsql
      richfaces.skin=DEFAULT
      hibernate.default_catalog.null=
      hibernate.default_schema=PROTO
      database.drop=y
      project.name=SeamPropertiesIssue
      hibernate.connection.username=sa
      hibernate.connection.driver_class=org.hsqldb.jdbcDriver
      hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
      project.type=ear
      icefaces.home=
      database.exists=n
      jboss.home=C\:/java/jboss-4.2.2.GA
      hibernate.dialect=org.hibernate.dialect.HSQLDialect
      hibernate.connection.url=jdbc\:hsqldb\:.

      Seam Managed Bean:

      package de.issue.action;

      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.log.Log;

      @Name("issuebean")
      public class IssueBean {

      @Logger
      Log log;

      String value="Value has not been set";

      public String getValue() {
      return value;
      }

      public void setValue(String value) {
      this.value = value;
      }

      public String checkValue() {
      log.info("the issue has the value #0", getValue());
      return "";
      }

      }


      View:

      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">


      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      Issue Concerning seam.properties




      <h:form>




      <h1>Push the button and check if the properties will set the set the seam managed valuebean</h1>



      <h:outputText value="#{issuebean.value}"></h:outputText>



      <h:commandButton type="submit" value="Push" action="#{issuebean.checkValue()}">
      </h:commandButton>
      </h:form>





      seam.properties:

      issuebean.value=Value has been set