在访问MyAdmin/user/ 时,调用index,返回一个login.html, 返回代码是:render("login.html");
在访问MyAdmin/prd/ 时,调用index,返回一个prd-list.html, 返回代码是:render("prd-list.html"),这个时候就报错,报错如下:
JFinal-3.4 action report -------- 2018-08-26 22:39:42 -------------------------- Url : GET /prd/ Controller : com.dmm.admin.common.controller.PrdController.(PrdController.java:1) Method : index Interceptor : com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:1) -------------------------------------------------------------------------------- 2018-08-26 22:39:42 [ERROR]-[Thread: "http-bio-8080"-exec-6]-[com.jfinal.core.ActionHandler.handle()]: /prd/ com.jfinal.template.stat.ParseException: Syntax error: can not match end Template: "/view/prd-list.html". Line: 113 at com.jfinal.template.stat.Parser.parse(Parser.java:93) at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:158) at com.jfinal.template.Engine.getTemplate(Engine.java:139) at com.jfinal.render.TemplateRender.render(TemplateRender.java:61) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:103) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) 2018-08-26 22:39:42 [ERROR]-[Thread: "http-bio-8080"-exec-6]-[com.jfinal.core.JFinalFilter.doFilter()]: /prd/ java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:636) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:205) at com.jfinal.render.ErrorRender.render(ErrorRender.java:59) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:141) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)
如果在2中换成render("login.html");则是可以的
这个是什么原因呢?各位大神请赐教
Syntax error: can not match end
Template: "/view/prd-list.html". Line: 113
在 prd-list.html 的 113 行附近,有一个 #end 没有被匹配上
要特别注意指令小括号要成对,少了小括号也会引发一些问题