History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1243
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Rene Gielen
Reporter: Rene Gielen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WebWork

doubleselect tag causes exception, indicating invalid stack constitution assumption

Created: 16/Mar/06 12:04 PM   Updated: 18/Mar/06 09:18 AM
Component/s: Views, Examples, Component Management
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2


 Description  « Hide
When rendering
http://localhost:8080/showcase/tags/ui/example!input.action

the following exeption is thrown:
2006-03-16 18:59:50,991 WARN [OgnlValueStack.java:207] : Caught an exception while evaluating expression 'top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}' against value stack
java.lang.IllegalArgumentException: invalid comparison: com.opensymphony.webwork.showcase.UITagExample and java.lang.String
at ognl.OgnlOps.compareWithConversion(OgnlOps.java:93)
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.ASTTest.getValueBody(ASTTest.java:49)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.Ognl.getValue(Ognl.java:333)
at ognl.Ognl.getValue(Ognl.java:310)
at com.opensymphony.xwork.util.OgnlUtil.getValue(OgnlUtil.java:188)
at com.opensymphony.xwork.util.OgnlValueStack.findValue(OgnlValueStack.java:198)
at com.opensymphony.webwork.components.Component.findValue(Component.java:230)
at com.opensymphony.webwork.components.DoubleListUIBean.evaluateExtraParams(DoubleListUIBean.java:108)
at com.opensymphony.webwork.components.DoubleSelect.evaluateExtraParams(DoubleSelect.java:43)
at com.opensymphony.webwork.components.UIBean.evaluateParams(UIBean.java:874)
at com.opensymphony.webwork.components.UIBean.end(UIBean.java:581)
at com.opensymphony.webwork.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:21)
at org.apache.jsp.tags.ui.example_jsp._jspx_meth_ww_doubleselect_0(org.apache.jsp.tags.ui.example_jsp:419)
at org.apache.jsp.tags.ui.example_jsp._jspx_meth_ww_form_0(org.apache.jsp.tags.ui.example_jsp:202)
at org.apache.jsp.tags.ui.example_jsp._jspService(org.apache.jsp.tags.ui.example_jsp:111)
...

 All   Comments   Change History      Sort Order:
Rene Gielen - [17/Mar/06 09:58 AM ]
The exeption seen here is annoying, but seems to break nothing. It is closely related to the perticular ognl expression used for doubleListKey.

Rene Gielen - [17/Mar/06 10:28 AM ]
Rainer found error in ognl expression.
Wrong usage seems to be caused by wrong docs for doubleselect, fixed them as well.

Rene Gielen - [18/Mar/06 08:19 AM ]
The ognl expression fix helped avoiding the exception, but it breaks functionality :)

The former solution was correct, although exception was thrown.

Rene Gielen - [18/Mar/06 09:01 AM ]
Lowering Priority, since this is not a real bug, just disturbing warning message. Does not break any functionality.

Rene Gielen - [18/Mar/06 09:18 AM ]
The exception seen here is directly related to the "official" example usage ognl expression for the doubleList parameter. The problem is that this expression cannot be evaluated correctly _before_ rendering the component, but will play nice when evaluated by js calls doing evaluation _after_ component is rendered. This is by design, even if it looks strange.

As a result I came to the question if the WARN notice about exception thrown when trying to evaluate an OGNL expression is always desirable. Came to the opinion that it might be desirable in devMode, but when we are in production mode, we should consider it a DEBUG information, therefore logging level should be lowered accordingly.

Applied the said change to OgnlValueStack. Note that this will not completely fix the problem, but help users of production systems not being scared up without good reason.

Anyone may feel free to reopen this issue if reasonable.