问题描述
很奇怪,不加<s:debug>标签在JSP文件里可以顺利执行没什么错误,可是只要一加这个标签就报错:错误如下StrutsProblemReportStrutshasdetectedanunhandledexception:Messages:ExceptioninJSP:/showUsers.jsp:3330:31:32:33:34:35:36:Stacktrace:File:org/apache/jasper/servlet/JspServletWrapper.javaLinenumber:451--------------------------------------------------------------------------------Stacktracesorg.apache.jasper.JasperException:ExceptioninJSP:/showUsers.jsp:3330:31:32:33:34:35:36:Stacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:659)org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457)org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:837)org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1287)java.lang.Thread.run(Thread.java:619)--------------------------------------------------------------------------------Youareseeingthispagebecausedevelopmentmodeisenabled.Developmentmode,ordevMode,enablesextradebuggingbehaviorsandreportstoassistdevelopers.Todisablethismode,set:struts.devMode=falseinyourWEB-INF/classes/struts.propertiesfile.百度GOOGLE都查了也找不到答案,求大神求解答,万分感谢
解决方案
解决方案二:
showUsers.jsp:33这一行(33行)都有些什么啦。你另外写一个空的JSP文件试过没有?
解决方案三:
ShowUsers.jsp如下:<%@pagelanguage="java"import="java.util.*"pageEncoding="GB18030"%><%@tagliburi="/struts-tags"prefix="s"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"><html><head><basehref="<%=basePath%>"><title>MyJSP'showUser.jsp'startingpage</title><metahttp-equiv="pragma"content="no-cache"><metahttp-equiv="cache-control"content="no-cache"><metahttp-equiv="expires"content="0"><metahttp-equiv="keywords"content="keyword1,keyword2,keyword3"><metahttp-equiv="description"content="Thisismypage"><!--<linkrel="stylesheet"type="text/css"href="styles.css">--></head><body><s:iteratorvalue="users"><s:propertyvalue="username"/></s:iterator><s:debug></s:debug></body></html>就是那个<s:debug></s:debug>如果不加上运行很成功,能显示出遍历的数组List<User>users内容来,可是加上<s:debug></s:debug>页面就报错,囧死了
解决方案四:
引用2楼long407226951的回复:
<!--<linkrel="stylesheet"type="text/css"href="styles.css">-->
先把样式拿掉看看。最好用个空页面先试一下。
解决方案五:
今天试了一下,什么都没改过,运行又可以了。。。真是奇怪。。。无语了。。。