0 Replies Latest reply on May 25, 2007 2:34 AM by nathan dennis

    Seam Component Property Error (Weirdness)

    nathan dennis Expert

      Jboss 4.0.5
      seam 1.2 patch1
      blah, blah, blah

      i recently had what i believe to be a strange occurrence while writing a very simple app.

      pay attention to destaddress property of Formmail...

      @Table(name = "formmail")
      public class Formmail implements Serializable {
       private static final long serialVersionUID = 1L;
       private String form;
       private String destaddress;
       @Length(max = 10)
       public String getForm() {
       return this.form;
       public void setForm(String form) {
       this.form = form;
       @Length(max = 80)
       public String getDestAddress() {
       return this.destaddress;
       public void setDestAddress(String destaddress) {
       this.destaddress = destaddress;
       public String toString()
       return "Formmail(" + form + "," + destaddress + ")";
      import javax.ejb.Local;
      public interface FormmailSearch {
       public int getPageSize();
       public void setPageSize(int pageSize);
       public String getSearchString();
       public void setSearchString(String searchString);
       public String getSearchPattern();
       public void find();
       public void nextPage();
       public boolean isNextPageAvailable();
       public void destroy();
      public class FormmailSearchAction implements FormmailSearch
       private EntityManager em;
       private String searchString;
       private int pageSize = 10;
       private int page;
       private List<Formmail> formmails;
       public void find()
       page = 0;
       public void nextPage()
      private void queryFormmails()
       formmails = em.createQuery("select f from Formmail f where lower(f.form) like #{pattern}")
       .setFirstResult( page * pageSize )
       public boolean isNextPageAvailable()
       return formmails!=null && formmails.size()==pageSize;
       public int getPageSize() {
       return pageSize;
       public void setPageSize(int pageSize) {
       this.pageSize = pageSize;
       @Factory(value="pattern", scope=ScopeType.EVENT)
       public String getSearchPattern()
       return searchString==null ?
       "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
       public String getSearchString()
       return searchString;
       public void setSearchString(String searchString)
       this.searchString = searchString;
       @Destroy @Remove
       public void destroy() {}
      <a:outputPanel id="searchResults">
       <div class="section">
       <h:outputText value="No Entrys Like That Found" rendered="#{formmails != null and formmails.rowCount==0}"/>
       <h:dataTable id="formmails" value="#{formmails}" var="mail" rendered="#{formmails.rowCount>0}">
       <f:facet name="header">Form:</f:facet>
       <f:facet name="header">Destination Address</f:facet>
       <s:link id="viewFormmail" value="View Record" action="#{formmailPersist.selectFormmail(mail)}"/>
       <s:link value="More results" action="#{formmailSearch.nextPage}" rendered="#{formmailSearch.nextPageAvailable}"/>

      this gave me a error
      Exception during request processing: javax.servlet.ServletException: /FormmailList.xhtml: Bean: com.foo.Formmail, property: destaddress
      after banging my head against the table for a while,, i figured out that Seam had changed the property name from destaddress to destAddress.


      I went back and change the name of the column in my db,, then alter my code a little... none of the weird junk,,, just with destaddress-->destAddress.

      explanation anyone???

      what don't i understand??
      i mean randomly mapping characters in a variable name string to upper case makes the mapping a little difficult if you catch my drift.