PDA

View Full Version : decision-state



ricsouzamoura
Jul 11th, 2005, 03:52 PM
Hi Folks
I have been trying to use the element <decision-state>, but I have had some problems.
At the bigining I was get a error. But reading the forum I have discovered thar I needed put the ognl.jar in my classpath.
After this I get a new error that I didn't get discover in the forum.

When I use

<decision-state id="decision1">
<if test="${flowScope.form1.field1 == 'F'}" then="view1" />
</decision-state>

the ognl try to converter my field1 to double and... NumberFormatException

I opened the source of ognl and I saw that there is a case structure that should do what I supposed: field1.compare('F'), but it only happend if both of variables (field1 and 'F') was a String. What I perceived was the 'F' is being worked like a Character.

Does somebody has this problem ?
Does somebody has any suggestion ?

Thanks in advance

klr8
Jul 20th, 2005, 08:57 AM
Bizar problem. Could you post the full stack trace?
This seems like an OGNL related issue. Maybe post something on their forums.

Erwin

ricsouzamoura
Jul 22nd, 2005, 04:37 PM
Unfortunaly I erased the stack trace and correct my problem using a variable.
But the source code from OGNL show me why it happend. To me it is a BUG, but...
the OGNL handle the 'F' as a character and flowScope.form1.field1 as a String. In the OgnlOps class there is a switch that try to do a Double.parseDouble() with this situation...

Thanks

kchaturv
Nov 1st, 2005, 06:24 PM
Unfortunaly I erased the stack trace and correct my problem using a variable.
But the source code from OGNL show me why it happend. To me it is a BUG, but...
the OGNL handle the 'F' as a character and flowScope.form1.field1 as a String. In the OgnlOps class there is a switch that try to do a Double.parseDouble() with this situation...

Thanks


I am getting the same error in decision state.
I am trying to test a string

<if test="${flowScope.isChild == 'true'}" then="someTransition">
in decision state and if falls over with error NumberFormatException.

My question is can we get a new version of OGNL that has fixed this bug. if not I want to use a apache commons EL parser with Spring Webflow instead of OGNL. How can i configure webflow to use the apache parser?

venkateshreddy
Jun 27th, 2008, 09:05 AM
Hi Folks
I have been trying to use the element <decision-state>, but I have had some problems.
At the bigining I was get a error. But reading the forum I have discovered thar I needed put the ognl.jar in my classpath.
After this I get a new error that I didn't get discover in the forum.

When I use

<decision-state id="decision1">
<if test="${flowScope.form1.field1 == 'F'}" then="view1" />
</decision-state>

the ognl try to converter my field1 to double and... NumberFormatException

I opened the source of ognl and I saw that there is a case structure that should do what I supposed: field1.compare('F'), but it only happend if both of variables (field1 and 'F') was a String. What I perceived was the 'F' is being worked like a Character.

Does somebody has this problem ?
Does somebody has any suggestion ?

Thanks in advance




hi,
<decision-state id="testvalue1">
<if test="${(flowScope.latestyear < 2008)}" then="view1" />
</decision-state>

will it work, or can u ppl suggest how to test greater than/lessthan condition.

JamesRussell
Jul 14th, 2008, 09:06 AM
Ran into the same issues for comparing a Character, as a String.

Try something like this:

<decision-state id="decision1">
<if test="${(flowScope.form1.field1 == 'F'.toString())}" then="view1" />
</decision-state>