html表单中传入部门参数为一个数组(<input type="checkbox" name="DeptID" id="DeptID" value="<%=rs.getString("id")%> "></td>),后端报表sql为:Deptid in ('${DeptID}'), 但是结果DeptID数组只处理一个值?
请问如何在报表模板中定义一个数组类型的参数接受html表单传入的数组值?
谢谢各位大侠! :) 作者: admin 时间: 2012-6-18 11:06
请用以下方法即可:
Deptid in ('${StringUtils.join($httpRequest.getParameterValues("DeptID"))}') 作者: smarpkey 时间: 2012-6-24 21:39
已经在JSP中包含了StringUtils类(<%@page import="org.apache.commons.lang.StringUtils" %>), 但是还是报错找不到StringUtils类和join方法,报错如下:
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils :
at Line: 1 : in file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : StringUtils .join ( $httpRequest .getParameterValues ( "DeptID" ) ) 作者: smarpkey 时间: 2012-6-24 22:08
已经在JSP中包含了StringUtils类(<%@page import="org.apache.commons.lang.StringUtils" %>), 但是还是报错找不到StringUtils类和join方法,报错如下:
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils :
at Line: 1 : in file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : StringUtils .join ( $httpRequest .getParameterValues ( "DeptID" ) ) 作者: smarpkey 时间: 2012-6-24 22:09
已经在JSP中包含了StringUtils类(<%@page import="org.apache.commons.lang.StringUtils" %>), 但是还是报错找不到StringUtils类和join方法,报错如下:
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils
Sourced file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : Attempt to resolve method: join() on undefined variable or class name: StringUtils :
at Line: 1 : in file: StringUtils.join($httpRequest.getParameterValues("DeptID")) : StringUtils .join ( $httpRequest .getParameterValues ( "DeptID" ) ) 作者: admin 时间: 2012-6-25 09:51
调用栈如下,是不是('${StringUtils.join($httpRequest.getParameterValues("DeptID"))}')语法错误?
Sourced file: httpRequest.getParameterValues("DeptID") : Attempt to resolve meth
od: getParameterValues() on undefined variable or class name: httpRequest
Sourced file: httpRequest.getParameterValues("DeptID") : Attempt to resolve meth
od: getParameterValues() on undefined variable or class name: httpRequest : at L
ine: 1 : in file: httpRequest.getParameterValues("DeptID") : httpRequest .getPar
ameterValues ( "DeptID" )
at bsh.UtilEvalError.toEvalError(UtilEvalError.java:85)
at bsh.UtilEvalError.toEvalError(UtilEvalError.java:90)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:74)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:114)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:55)
at bsh.Interpreter.eval(Interpreter.java:816)
at bsh.Interpreter.eval(Interpreter.java:777)
at bsh.Interpreter.eval(Interpreter.java:1030)
at bsh.Interpreter.eval(Interpreter.java:1020)
at jatools.engine.script.ReportContext.eval(ReportContext.java:273)
at jatools.engine.script.ReportContext.evalTemplate(ReportContext.java:224)
at jatools.data.reader.sql.SqlReader.readStart(SqlReader.java:205)
at jatools.data.reader.sql.SqlReader.getDataset(SqlReader.java:490)
at jatools.data.reader.sql.SqlReader.doRead(SqlReader.java:481)
at jatools.data.reader.AbstractDatasetReader.read(AbstractDatasetReader.java:88)
at jatools.dom.src.DatasetNodeSource.create(DatasetNodeSource.java:130)
at jatools.dom.NodeFactory.createChildNodes(NodeFactory.java:45)
at jatools.dom.ElementBase.getChildElements(ElementBase.java:500)
at jatools.dom.DatasetBasedNode.getLength(DatasetBasedNode.java:393)
at jatools.dom.DatasetBasedNode.getFirstChild(DatasetBasedNode.java:236)
at org.jaxen.dom.DocumentNavigator$1.getFirstNode(DocumentNavigator.java:155)
at org.jaxen.dom.DocumentNavigator$NodeIterator.<init>(DocumentNavigator.java:895)
at org.jaxen.dom.DocumentNavigator$1.<init>(DocumentNavigator.java:152)
at org.jaxen.dom.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:152)
at org.jaxen.expr.iter.IterableChildAxis.iterator(IterableChildAxis.java:76)
at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:199)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213)
at jatools.engine.printer.AbstractPrinter.createCursor(AbstractPrinter.java:250)
at jatools.engine.printer.AbstractContainerPrinter.print(AbstractContainerPrinter.java:217)
at jatools.engine.printer.table.TablePrinter.print(TablePrinter.java:67)
at jatools.engine.printer.table.TablePrinter.print(TablePrinter.java:133)
at jatools.engine.printer.PowerTablePrinter.printHeader(PowerTablePrinter.java:219)
at jatools.engine.printer.PowerTablePrinter.printChildren(PowerTablePrinter.java:142)
at jatools.engine.printer.AbstractContainerPrinter.next(AbstractContainerPrinter.java:298)
at jatools.engine.printer.AbstractContainerPrinter.print(AbstractContainerPrinter.java:233)
at jatools.engine.printer.AbstractContainerPrinter.printChildren(AbstractContainerPrinter.java:150)
at jatools.engine.printer.AbstractContainerPrinter.next(AbstractContainerPrinter.java:298)
at jatools.engine.printer.AbstractContainerPrinter.print(AbstractContainerPrinter.java:233)
at jatools.engine.printer.AbstractContainerPrinter.printChildren(AbstractContainerPrinter.java:150)
at jatools.engine.printer.AbstractContainerPrinter.next(AbstractContainerPrinter.java:298)
at jatools.engine.printer.AbstractContainerPrinter.print(AbstractContainerPrinter.java:233)
at jatools.engine.printer.ReportPrinter.print(ReportPrinter.java:266)
at jatools.engine._Job.generatePage(_Job.java:150)
at jatools.engine._Job.printAsDHTML2(_Job.java:123)
at jatools.engine.ReportJob.printAsDHTML(ReportJob.java:137)
at jatools.tags.ReportTag.writeOut(ReportTag.java:156)
at jatools.tags.ContainerTag.writeOut(ContainerTag.java:78)
at org.apache.jsp.report.mainTableProc_jsp._jspService(mainTableProc_jsp.java:277)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 作者: admin 时间: 2012-6-28 10:17