ELException in Spring Webflow

If an ELException has occurred in Spring Webflow, check the error message and the method where the error has occurred. In a case that I have encountered, the flowScope variable in the flow.xml file did not match the defined variable in the Service interface file. Below is an example of a correct flow.xml and service.java variable mapping. If in case the return of methodA is changed to Integer instead of String, this will throw an ELExeption on runtime. However, the code will compile without any errors.

Service Interface file (Interface.java)


public interface InterfaceService {

//....

String methodA(){

//....

}

String methodB(String parameterB){

//....

}

Service Implementation file (Implementation.java)


public class Implementation implements InterfaceService {

//implements methodA and methodB

Spring webflow (flow.xml) file


<evaluate expression="InterfaceService.methodA()" result="flowScope.stringValue" />
<evaluate expression="InterfaceService.methodB(stringValue)"/>

EL is an abreviation of Expresion Language in Spring Webflow. The flowScope variable is one of several variables provided by Spring Webflow. Other Spring Webflow variables such as requestScope, flashScope and viewScope can also cause an ELException when a mismatch of data types occur.

Spring documentation on EL ( Expression Language ) and flowScope found in 4.4.1
http://docs.spring.io/autorepo/docs/webflow/2.3.x/reference/html/el.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s