struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <w...@wantii.com>
Subject Re: [S2] doubleselect problem with Maps
Date Sun, 31 Aug 2008 23:34:36 GMT
Gabriel,

I can't get your JSP to render either. If I use list="{'fruit',
'other'}" then the page seems to render properly. I need to look closer
at the source before I can explain why it's broken. I haven't used this
tag before. 

-Wes

On Sun, 2008-08-31 at 16:45 -0300, Gabriel Belingueres wrote:
> Hi Wes, no it didn't worked:
> 
> Here is my test page:
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>     pageEncoding="ISO-8859-1"%>
> <%@ taglib uri="/struts-tags" prefix="s" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> <title>Insert title here</title>
> </head>
> <body>
> <s:form action="xx" theme="simple">
>   <s:doubleselect label="doubleselect test2"
>   name="menu" list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}"
>   doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'}
> : {'monkey', 'chicken'}" />
> </s:form>
> </body>
> </html>
> 
> Without the backslash it shows the following log (but at least the
> upper select is rendered):
> 
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [org.apache.catalina.jsp_file]
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [struts.valueStack]
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,359  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,375  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [.freemarker.Request]
> 2008-08-31 16:41:47,375  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [.freemarker.RequestParameters]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [menu]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:50) - Caught an exception
> while evaluating expression 'top == 'fruit' ? {'apple', 'orange'} :
> {'monkey', 'chicken'}' against value stack
> java.lang.IllegalArgumentException: invalid comparison:
> com.opensymphony.xwork2.DefaultTextProvider 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.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:201)
> 	at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:224)
> 	at org.apache.struts2.components.Component.findValue(Component.java:253)
> 	at org.apache.struts2.components.DoubleListUIBean.evaluateExtraParams(DoubleListUIBean.java:138)
> 	at org.apache.struts2.components.DoubleSelect.evaluateExtraParams(DoubleSelect.java:61)
> 	at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:858)
> 	at org.apache.struts2.components.UIBean.end(UIBean.java:509)
> 	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
> 	at org.apache.jsp.testdoubleselect_jsp._jspx_meth_s_005fdoubleselect_005f0(testdoubleselect_jsp.java:136)
> 	at org.apache.jsp.testdoubleselect_jsp._jspx_meth_s_005fform_005f0(testdoubleselect_jsp.java:102)
> 	at org.apache.jsp.testdoubleselect_jsp._jspService(testdoubleselect_jsp.java:65)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:461)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
> 	at java.lang.Thread.run(Unknown Source)
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - NOTE: Previous
> warning message was issued due to devMode set to true.
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [dishes]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,390  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,406  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [fieldErrors]
> 2008-08-31 16:41:47,406  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [fieldErrors]
> 2008-08-31 16:41:47,421  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,421  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,421  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:41:47,421  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 
> 
> 
> WITH the backslash in the list attribute (list="\#{'fruit':'Nice
> Fruits', 'other':'Other Dishes'}") it shows the following log (but
> nothing is rendered at all):
> 
> 2008-08-31 16:43:49,062  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [org.apache.catalina.jsp_file]
> 2008-08-31 16:43:49,250  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [struts.valueStack]
> 2008-08-31 16:43:49,250  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,250  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,250  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,250  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,265  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [.freemarker.Request]
> 2008-08-31 16:43:49,265  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [.freemarker.RequestParameters]
> 2008-08-31 16:43:49,281  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,296  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [templateDir]
> 2008-08-31 16:43:49,296  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [menu]
> 2008-08-31 16:43:49,296  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [\#{'fruit':'Nice Fruits', 'other':'Other Dishes'}]
> 2008-08-31 16:43:49,296  WARN
> (com.opensymphony.xwork2.ognl.OgnlValueStack:46) - Could not find
> property [\#{'fruit':'Nice Fruits', 'other':'Other Dishes'}]
> 2008-08-31 16:43:49,296 ERROR
> (org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/prueba].[jsp]:253)
> - Servlet.service() para servlet jsp lanzó excepción
> tag 'doubleselect', field 'list', name 'menu': The requested list key
> '\#{'fruit':'Nice Fruits', 'other':'Other Dishes'}' could not be
> resolved as a collection/array/map/enumeration/iterator type. Example:
> people or people.{name} - [unknown location]
> 	at org.apache.struts2.components.Component.fieldError(Component.java:230)
> 	at org.apache.struts2.components.Component.findValue(Component.java:292)
> 	at org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:80)
> 	at org.apache.struts2.components.DoubleListUIBean.evaluateExtraParams(DoubleListUIBean.java:96)
> 	at org.apache.struts2.components.DoubleSelect.evaluateExtraParams(DoubleSelect.java:61)
> 	at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:858)
> 	at org.apache.struts2.components.UIBean.end(UIBean.java:509)
> 	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
> 	at org.apache.jsp.testdoubleselect_jsp._jspx_meth_s_005fdoubleselect_005f0(testdoubleselect_jsp.java:136)
> 	at org.apache.jsp.testdoubleselect_jsp._jspx_meth_s_005fform_005f0(testdoubleselect_jsp.java:102)
> 	at org.apache.jsp.testdoubleselect_jsp._jspService(testdoubleselect_jsp.java:65)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:461)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> 2008/8/29 Wes Wannemacher <wesw@wantii.com>:
> > This is a bit obscure, but try to use list="\#{
> >
> > (notice the backslash before the hash mark.)
> >
> > If that works, I'll explain why...
> >
> > -Wes
> >
> > On Fri, 2008-08-29 at 23:20 -0300, Gabriel Belingueres wrote:
> >> (Posted this in user list a few days ago without luck)
> >>
> >> Hi,
> >>
> >> I tried to run (using S2.1.2) the Map example code of doubleselect tag
> >> [1] but it doesn't work.
> >> (The dependent select shows empty.)
> >>
> >> Does anyone knows if either it's a mistake in the docs or the tag just
> >> don't work for Maps?
> >>
> >> Regards,
> >> Gabriel
> >>
> >> [1] http://struts.apache.org/2.1.2/docs/doubleselect.html
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


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


Mime
View raw message