关于logic:iterate中的indexId

在我们以前比较熟悉的detail页面中比如lendslipdetail,里面可以看到logic:iterate,这个是起到一个循环作用的,它是从一个vector拿数据,或者向一个vector放数据,但是一个vector里面有多个hashmap,所以需要定义indexId如indexId="idx",然后在需要放入vector的元素行上加上colIndex="<%= idx %>,这样该元素就可以放入你所定义的vector里面了
阅读更多
换一批

关于logiciterate的小问题吗?

12-02

departmentList 页面rnrn rn rn rn rn rn rn rn rn rnrn对应的显示的actionrnpublic class ListDepartmentAction extends Actionrnrn ServiceImpl service ;rn rn public void setService(ServiceImpl service) rn this.service = service;rn rnrn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response)rn throws Exception rn rn int departmentCount = service.getDepartmentCount();rn if (departmentCount < 1)rn rn request.setAttribute("message" , "没有任何部门");rn // return mapping.findForward("success");rn rn int pageCount = service.getPageCount(departmentCount , service.PAGE_SIZE);rnrn int pageNo;rn if (request.getParameter("pageNo") == null || request.getParameter("pageNo").trim().equals(""))rn rn pageNo = 1;rn rn tryrn rn pageNo = Integer.parseInt(request.getParameter("pageNo").trim());rn rn catch (Exception e)rn rn pageNo = 1;rn rn //如果请求页已经超出了最大页rn if (pageNo > pageCount)rn rn pageNo = pageCount;rn rn request.setAttribute("pageCount" , pageCount);rn request.setAttribute("currentPage" , pageNo);rn request.setAttribute("departmentList" , service.listPeople(pageNo)); //departmentList是在这里呀....rn return mapping.findForward("success");rnrnrn可是运行时老会说rnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /departmentList.jsp at line 36rnrn33: ___I D部门名称管理人___rn34: rn35: rn36: rn37: rn38: rn39: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjavax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "departmentList" in any scopern org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)rn org.apache.jsp.departmentList_jsp._jspService(departmentList_jsp.java:174)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjavax.servlet.jsp.JspException: Cannot find bean: "departmentList" in any scopern org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)rn org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)rn org.apache.jsp.departmentList_jsp._jspService(departmentList_jsp.java:119)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/6.0.14rnrnrn小弟菜鸟一个 恳求各位高手求教~

关于struts logic:iterate的问题

05-22

大家好! 请问这段代码有什么问题,谢谢rnshoppingFrom 中包含一个Arraylist productList.rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 放入购物车rnrn rn rnrnaction中有这一段:rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request,rn HttpServletResponse response) rn ShoppingForm shoppingForm = (ShoppingForm) form;rn String event=shoppingForm.getEvent();rn ShoppingBo bo=ShoppingBo.getInstance();rn ..... rn shoppingForm.setProductList((ArrayList)bo.getProductList());rn return mapping.findForward("shopping");rnrn rn出现如下的错误rnexception javax.servlet.ServletException: No collection foundrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)rn org.apache.jsp.shopping_jsp._jspService(org.apache.jsp.shopping_jsp:254)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnjavax.servlet.jsp.JspException: No collection foundrn org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:238)rn org.apache.jsp.shopping_jsp._jspService(org.apache.jsp.shopping_jsp:160)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn

关于struts中logic:iterate的问题,急。

07-13

struts-config.xml内容:rnrnrnrn rn rn rn rn rn rn rn rnrnrnworkAction.java内容:rnpackage src;rnimport org.apache.struts.action.*;rnimport javax.servlet.http.*;rnpublic class workAction extends Action rnpublic ActionForwardrn execute(ActionMapping mapping,rn ActionForm form, HttpServletRequest req,rn HttpServletResponse res)rn workActionForm myform=(workActionForm)form;rn String[][] temp = "a1","a2","a3","b1","b2","b3";rn myform.setabc(temp);rn return(mapping.findForward("success"));rn rnrnrnworkActionForm.java内容:rnpackage src;rnimport org.apache.struts.action.*;rnimport javax.servlet.http.*;rnimport javax.servlet.http.HttpServletRequest;rnpublic class workActionForm extends ActionForm rn private String[][] abc = null;rn public void setabc(String[][] abc) rn this.abc = abc;rn rn public String[][] getabc() rn return this.abc;rn rn rn public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) rn return null;rn rn public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) rn rn rnrnwork.jsp内容:rn<%@ page contentType="text/html;charset=UTF-8" language="java" %>rn<%@ taglib uri="WEB-INF/struts-bean.tld" prefix="bean" %>rn<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>rn<%@ taglib uri="WEB-INF/struts-logic.tld" prefix="logic" %>rn<%@ taglib uri="WEB-INF/struts-nested.tld" prefix="nested" %>rn<%@ taglib uri="WEB-INF/struts-template.tld" prefix="template" %>rn<%@ taglib uri="WEB-INF/struts-tiles.tld" prefix="tiles" %>rnrnrn rnworkrnrnrnrn rnwelcome to my test !!rnrnrnrnrnrn <% String[] temp = (String[]) workActionForm; %>rn <%=temp[0]%> | <%=temp[1]%> | <%=temp[2]%> rnrnrnrn想实现在表格中输出数组的功能,但总不能实现。。请各位帮帮忙。(以上报错为no collection found)谢谢

jsp中logiciterate出错

11-07

jsp中:rn[code=Java]rnrn rn rn rnrn[/code]rnjava类rn[code=Java]rnif (url.equals("/bfm/products.jsp")) rn DBSource ds = new DBSource();rn List li=ds.DBSource(request, "getServices");rn request.setAttribute("ServicesList", li);rn System.out.println("执行了");rnrn[/code]rnrn出现如下错误;怎么回事rnrn执行了rn2008-11-7 14:22:25 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet jsp threw exceptionrnjavax.servlet.jsp.JspException: No getter method for property: "" of bean: "custclass"rn at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:915)rn at org.apache.struts.taglib.html.CheckboxTag.isChecked(CheckboxTag.java:151)rn at org.apache.struts.taglib.html.CheckboxTag.doStartTag(CheckboxTag.java:124)rn at org.apache.jsp.bfm.products_jsp._jspx_meth_html_005fcheckbox_005f0(products_jsp.java:414)rn at org.apache.jsp.bfm.products_jsp._jspService(products_jsp.java:146)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.by.bfm.filter.FormFilter.doFilter(FormFilter.java:92)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnrnrnrnServices类是由spring生成的Services表的beanrn望高手指教rn

logic:iterate的问题

12-28

代码:rn<%rnArrayList a = (ArrayList)request.getAttribute("list");rnfor (int i=0; irnrn rnrnrn输出如下:为什么Cannot find bean item in any scope?rn####0: Firstrn####1: Secondrn####2: Thirdrn####3: Fourthrn####4: Fifthrn2005-12-28 10:41:17,859 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cms].[jsp]] - rnjavax.servlet.jsp.JspException: Cannot find bean item in any scopern at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934)rn at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:225)rn at org.apache.jsp.web.main_jsp._jspx_meth_bean_write_0(org.apache.jsp.web.main_jsp:117)rn at org.apache.jsp.web.main_jsp._jspService(org.apache.jsp.web.main_jsp:87)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:595)

没有更多推荐了,返回首页