您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 综合/其它 > java错误完整汇总
错误一:如果你也遇到以下问题:java.lang.IllegalArgumentException:Pathindex.jspdoesnotstartwitha/characterorg.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)model.MyActionServlet.process(MyActionServlet.java:22)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)javax.servlet.http.HttpServlet.service(HttpServlet.java:710)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)那么,请注意了。你的struts-config.xml文件一定是出错了,就仔细看看action-mappings/吧!特别是action里面path=/admin/newsinput=/xxx.jspforwardname=successpath=/tran.jsp/如input=logon.jsp==>input=/logon.jsppath=admin/news==path=/admin/newsforwardname=successpath=tran.jsp/==forwardname=successpath=/tran.jsp/有时,不一定是配置文件出的错。看看你的Action中的execute()方法,特别是retrunmapping.findForward(XXXXXXXXXXX),我今天就错在这里了,本来的意思是returnmapping.findForward(editnews);可我却写成returnnewActionForward(newslist);其实这句也对(如放在删除或者添加后面的跳转),只不过放在这里就不对了,因为我的editnews在配置文件里已经定义过别名了forwardname=editnewspath=/admin/newsedit.jsp/============================初学struts有些问题要注意!我在这里说一些比较细的地方,都是我遇到过的,其他方面网上书上都说得很详细了。struts-config.xml文件,这是很重要的地方,成败的关键啊!!一般的样式就是这样,红色部分要注意?xmlversion=1.0encoding=UTF-8?!DOCTYPEstruts-configPUBLIC-//ApacheSoftwareFoundation//DTDStrutsConfiguration1.1//EN=userLoginFormtype=com.yourcompany.struts.form.UserLoginForm//form-beansglobal-exceptions/global-forwards/action-mappingsaction------虽然在Eclipse开发当中,顺序不是这样,但是出问题时可以考虑先改这里的顺序,我试过在这里改了以后问题解决了。attribute=userLoginForminput=/userLogin.jspname=userLoginFormpath=/userLoginscope=requesttype=com.yourcompany.struts.action.UserLoginActionvalidate=false-------“/”这个也要注意,我在网上找错的时候,发现有不少也有这个错误Path文件名字doesnotstartwitha/character记得加“/”这个,很容易就忘记,我是连续忘记了两次,错误二:HTTPStatus500-typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionorg.apache.jasper.JasperException:ExceptioninJSP:/register/registerForm.jsp:3835:/form36:37:tabletrtdfontcolor=red用el表达式读取所有request作用中的错误对象:/font/tdtd${requestScope[org.apache.struts.action.ERROR]}/td/tr38:trtdfontcolor=red用html标签读取所有request作用中的错误对象:/font/tdtdhtml:errors//td/tr39:/table40:table41:trtd/tdStacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:966)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:710)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rootcausejavax.servlet.ServletException:Cannotfindmessageresourcesunderkeyorg.apache.struts.action.MESSAGEorg.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)org.apache.jsp.register.registerForm_jsp._jspService(registerForm_jsp.java:154)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:966)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:710)javax.s
本文标题:java错误完整汇总
链接地址:https://www.777doc.com/doc-4391539 .html