Lew wrote:
>> You have a backing bean named "test" defined by a "managed-bean" tag in
>> the
>> faces-config.xml, or should, that is invoked by "action" attribute of a
>> commandButton or commandLink in your JSP, which code you have not shown
>> us. Either the bean doesn't have a test() method or you failed to define
>> that backing bean in your faces-config.xml.
> <h:commandButton value="Click me" action="#{test.test}"/>
That confirms part of what I said, yes.

Signature
Lew
qweer - 13 Aug 2007 15:11 GMT
> That confirms part of what I said, yes.
Ok. I dont't understand something. Do I have to create bean in war project?
Now, I have faces config like that:
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<application>
<view-handler>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
<lifecycle>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</lifecycle>
<application>
<el-resolver>
org.jboss.seam.jsf.SeamELResolver
</el-resolver>
</application>
<managed-bean>
<managed-bean-name>test</managed-bean-name>
<managed-bean-class>test.TestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
and
<h:form>
<h:commandButton value="Click me" action="#{test.test}"/>
</h:form>
in template-client.xhtml. I have the same error like before. What do I have
to do to eliminate this isue? Sorry, I'm newbe.
Lew - 13 Aug 2007 21:17 GMT
>> That confirms part of what I said, yes.
>
> Ok. I dont't understand something. Do I have to create bean in war project?
I'm not sure what you mean by this question. If you mean, "Must there be a
class in the project that corresponds to the managed bean class?" the answer
is, "Yes." If you mean, "Must there be an explicit instantation of the
TestBean class?" the answer is, "No."
> <h:form>
> <h:commandButton value="Click me" action="#{test.test}"/>
> </h:form>
>
> in template-client.xhtml. I have the same error like before. What do I have
> to do to eliminate this isue? Sorry, I'm newbe.
Does "test.TestBean" have a "public String test()" method?
Does the test() method return a String (or Object with a toString() that
returns a String) that represents the outcome of the action?
I am not familiar with facelets, so I don't know if you need a
"navigation-rule" element in your faces-config.xml that corresponds to that
return value, but I suspect that you do. You would if you were using just JSF
without facelets.

Signature
Lew
qweer - 13 Aug 2007 23:53 GMT
> Lew wrote:
>>> You have a backing bean named "test" defined by a "managed-bean" tag in
[quoted text clipped - 7 lines]
>
> That confirms part of what I said, yes.
I think I don't have to define in faces-config any manage bean (meybe I'm
wrong).
There is a part of seam ofiicial tutorial:
"The faces-config.xml file integrates Seam into JSF. Note that we don't need
any JSF managed bean declarations! The managed beans are the Seam
components. In Seam applications, the faces-config.xml is used much less
often than in plain JSF.
In fact, once you have all the basic descriptors set up, the only XML you
need to write as you add new functionality to a Seam application is the
navigation rules, and possibly jBPM process definitions. Seam takes the view
that process flow and configuration data are the only things that truly
belong in XML.
In this simple example, we don't even need a navigation rule, since we
decided to embed the view id in our action code.
"
Lew - 14 Aug 2007 00:06 GMT
>> Lew wrote:
>>>> You have a backing bean named "test" defined by a "managed-bean" tag in
[quoted text clipped - 8 lines]
> I think I don't have to define in faces-config any manage bean (meybe I'm
> wrong).
Maybe you don't, but you still have to have a test() method for the JSP EL
expression to invoke. Remember, your error is:
> javax.el.MethodNotFoundException: /template-client.xhtml @23,78
> action="#{test.test}": Method not found: test.TestLocal_15902127.test()
> javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException:
> /template-client.xhtml @23,78 action="#{test.test}": Method not found:
> test.TestLocal_15902127.test()
This tells you that the test() method doesn't exist. I also wonder what the
"TestLocal_.+" part of the class name is.
The problem is with the EL expression mentioned in the error message. Is
there such a method?

Signature
Lew