[jboss-user] [JBoss Seam] - avoiding excessive bijection question
X490812
do-not-reply at jboss.com
Mon Jul 9 18:35:35 EDT 2007
In Michael Yuan's seam book, there is a secion on avoiding excessive bijection.
I have tried to implement this idea in a test app with the following code:
the controller
| @Stateful
| @Name("indexPage")
| @Scope(org.jboss.seam.ScopeType.SESSION)
| public class IndexPageBean implements IndexPage {
|
| @Logger
| private Log log;
|
| @In
| FacesMessages facesMessages;
|
| private Property property;
|
|
| private Borrower borrower;
| .
| .
| .
| public Borrower getBorrower()
| {
| return borrower;
| }
| public void setBorrower(Borrower borrower)
| {
| this.borrower = borrower;
| }
| .
| .
| .
|
the view
| <div id="Borrower">
| <h2>Borrower</h2>
| <form name="BorrowerForm" id="BorrowerForm" jsfc="h:form">
| <div id="ageDiv">
| <label>AGE:
| <input type="text" name="textfield" jsfc="h:inputText" value="#{indexPage.borrower.age}"/>
| </label>
| </div>
| <div id="grossIncomeDiv">
| <label>GROSS:
| <input type="text" name="textfield" jsfc="h:inputText" value="#{indexPage.borrower.grossIncome}"/>
| </label>
| </div>
| <div id="submitBorrower">
| <input type="submit" jsfc="h:commandButton" id="submitBorrowerButton" action="#{indexPage.submitBorrower}" value="Submit" />
| </div>
| </form>
| </div>
| .
| .
| .
|
|
I am getting the error:
anonymous wrote :
| /home.xhtml @16,101 value="#{indexPage.borrower.age}": Bean: org.javassist.tmp.java.lang.Object_$$_javassist_91, property: borrower
|
with a stacktrace of
anonymous wrote :
| javax.faces.el.PropertyNotFoundException: /home.xhtml @16,101 value="#{indexPage.borrower.age}": Bean: org.javassist.tmp.java.lang.Object_$$_javassist_91, property: borrower
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:135)
|
Why? It seams to be saying that I do not have a borrower property in my controller, yet that is not true. Is it because I must first initialize something? The book gives a very similar example, but I must be missing something.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062172#4062172
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062172
More information about the jboss-user
mailing list