Error in valueChangeListener

When i select an item, i get the following error.

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Exception while invoking expression #{Tester.listen}

javax.faces.webapp.FacesServlet.service(FacesServlet.java:154)

jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

javax.faces.el.EvaluationException: Exception while invoking expression #{Tester.listen}

org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:168)

javax.faces.component.UIInput.broadcast(UIInput.java:244)

javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)

javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:150)

org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32)

org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)

org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)

jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Here is the JSP code

<f:view>

<h:form>

<h:selectOneListbox valueChangeListener="#{Tester.listen}"

size="7" required="yes" onchange="this.form.submit()">

<f:selectItem itemLabel="one" itemValue="1" />

<f:selectItem itemLabel="two" itemValue="2" />

<f:selectItem itemLabel="three" itemValue="3" />

<f:selectItem itemLabel="four" itemValue="4" />

</h:selectOneListbox>

</h:form>

</f:view>

And my Bean code:

public class Tester {

public Tester(){

}

public void lisen(ValueChangeEvent e){

System.out.println("hello world");

}

}

What went wrong in the code?

[2115 byte] By [Intel3a] at [2007-11-27 11:08:06]
# 1

the component request the back bean value

eg:

<h:selectOneMenu value="#{}" onchange="submit()" valuechangeLintener=""

>

<f:selectItems value=""/>

</h:selectOneMenu>

lysmarta at 2007-7-29 13:26:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Your valueChangeListener method is called lisen, and in your code you are refering to it as Tester.listen. You need to change one or the other to make them the same. Basically your page can't find a method called listen in your bean because it is spelled wrong.

Regards,

Rich

richard_schramma at 2007-7-29 13:26:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...