You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by simon <si...@javawithchopsticks.de> on 2006/05/13 19:30:42 UTC

Expression validation error using actionListener

Hi there...

I cant get the bloody actionListener working. Hope for some advice...

I always receive this tomcat exception:


javax.servlet.ServletException: Exception while invoking expression  
#{ServiceBean.savePage}
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
	org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)

root cause

javax.faces.el.EvaluationException: Exception while invoking expression  
#{ServiceBean.savePage}
	org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
	javax.faces.component.UICommand.broadcast(UICommand.java:86)
	javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
	org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
	org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
	org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)



I do have the following code:

JSP:
<h:commandButton id="insertID" value="insert"   
actionListener="#{ServiceBean.savePage}" action="success" >

faces-config.xml
<managed-bean>	
<managed-bean-name>ServiceBean</managed-bean-name>
<managed-bean-class>package.name.PageServiceBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

JAVA:
public class PageServiceBean implements Serializable {
	private static final Log LOG = LogFactory.getLog(PageServiceBean.class);
	
	
	/**
	 * @param event
	 */
	public void savePage(ActionEvent event){
		do.something();
	}
----------------------------------
Simon Willnauer
mailto simon@javawithchopsticks.de

Re: Expression validation error using actionListener

Posted by simon <si...@javawithchopsticks.de>.
Thanks for your reply but there are no more exceptions...
but I figured it out, one of the jars are broken e.g. wrong checksum.
Now everything works fine. Thanks anyway.

simon

On Sat, 13 May 2006 19:50:47 +0200, Mario Ivankovits <ma...@ops.co.at>  
wrote:

> Hi Simon,
>> I always receive this tomcat exception:
>>
> Check your tomcat logs, there might be a "root-root" cause which
> explains in more detail whats going on.
> If you check the myfaces "simple" example (and the latest tomahawk)
> you'll find a error.jsp which you can configure in your web.xml to push
> this (the real exception) to the user.
>
>
>> <h:commandButton id="insertID" value="insert"
>> actionListener="#{ServiceBean.savePage}" action="success" >
>>
> Personally I wont use the actionListener to do the real work, what if
> savePage didnt succeed?
> Put the method call to action="" and you are able to return "failed" (or
> whatever) and do some special navigation - or stay on the same page if
> you simply "return null"
>
> Ciao,
> Mario
>

----------------------------------
Simon Willnauer
mailto simon@javawithchopsticks.de

Re: Expression validation error using actionListener

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Simon,
> I always receive this tomcat exception:
>   
Check your tomcat logs, there might be a "root-root" cause which
explains in more detail whats going on.
If you check the myfaces "simple" example (and the latest tomahawk)
you'll find a error.jsp which you can configure in your web.xml to push
this (the real exception) to the user.


> <h:commandButton id="insertID" value="insert"   
> actionListener="#{ServiceBean.savePage}" action="success" >
>   
Personally I wont use the actionListener to do the real work, what if
savePage didnt succeed?
Put the method call to action="" and you are able to return "failed" (or
whatever) and do some special navigation - or stay on the same page if
you simply "return null"

Ciao,
Mario