struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Martin <e...@ericmmartin.com>
Subject Re: OgnlValueStack.logLookupFailure
Date Wed, 27 Feb 2008 20:31:30 GMT

Thanks Dave, that seemed to do the trick. I have other places where I use the
same notation, but not with a single-character.

So, it looks like struts converts it to a Char if it's a single-character
and a string if it's multi-character?


newton.dave wrote:
> 
> IIRC a single-character in single quotes will evaluate to a character, not
> a
> string. Not entirely sure I get the exception without looking at the
> source.
> 
>> <s:if test='ruleType == "A"'>
> 
> should work, though (switched punctuation).
> 
> Dave
> 
> --- Eric Martin <eric@ericmmartin.com> wrote:
> 
>> 
>> I'm stuck with this error and have no idea what the problem is...
>> 
>> In my action class, I'm returning a String property called ruleType. I've
>> verified that it has a value of "A".
>> 
>> In my jsp, I have:
>> <s:if test="ruleType == 'A'">
>>    <%@include file="arithmeticDetail.jsp" %>
>> </s:if>
>> 
>> For some reason, that s:if test statement is throwing:
>> WARN - OgnlValueStack.logLookupFailure(269) | Caught an exception while
>> evaluating expression 'ruleType == 'A'' against value stack
>> java.lang.NumberFormatException: For input string: "A"
>> 	at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
>> 	at java.lang.Double.parseDouble(Unknown Source)
>> 	at ognl.OgnlOps.doubleValue(OgnlOps.java:214)
>> 	at ognl.OgnlOps.compareWithConversion(OgnlOps.java:99)
>> 	at ognl.OgnlOps.isEqual(OgnlOps.java:142)
>> 	at ognl.OgnlOps.equal(OgnlOps.java:533)
>> 	at ognl.ASTEq.getValueBody(ASTEq.java:51)
>> 	at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
>> 	at ognl.SimpleNode.getValue(SimpleNode.java:210)
>> 	at ognl.Ognl.getValue(Ognl.java:333)
>> 	at com.opensymphony.xwork2.util.OgnlUtil.getValue(OgnlUtil.java:194)
>> 	at
>>
> com.opensymphony.xwork2.util.OgnlValueStack.findValue(OgnlValueStack.java:238)
>> 	at org.apache.struts2.components.Component.findValue(Component.java:322)
>> 	at org.apache.struts2.components.If.start(If.java:85)
>> 	at
>>
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:54)
>> 	at
>>
> org.apache.jsp.WEB_002dINF.jsp.transformRule.saveRule_jsp._jspx_meth_s_005fif_005f1(saveRule_jsp.java:561)
>> 	at
>>
> org.apache.jsp.WEB_002dINF.jsp.transformRule.saveRule_jsp._jspService(saveRule_jsp.java:158)
>> ...
>> 
>> Any ideas?
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/OgnlValueStack.logLookupFailure-tp15721571p15721571.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/OgnlValueStack.logLookupFailure-tp15721571p15722468.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message