关于 web.xml 3.1 以及 jsp2.0下使用fmt标签 异常的问题

举报
码农小胖哥 发表于 2022/03/30 22:30:20 2022/03/30
【摘要】 错误为红字标识引起 Error rendering view [org.springframework.web.servlet.view.JstlView: name 'list'; URL [/WEB-INF/jsp/list.jsp]] in DispatcherServlet with name 'dispatcher'org.a...

  
  1. Error rendering view [org.springframework.web.servlet.view.JstlView: name 'list'; URL [/WEB-INF/jsp/list.jsp]] in DispatcherServlet with name 'dispatcher'
  2. org.apache.jasper.JasperException: /WEB-INF/jsp/list.jsp (line: 35, column: 16)
  3. <span style="color:#FF0000;"> According to TLD or attribute directive in tag file, attribute value does not accept any expressions</span>
  4. at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
  5. at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
  6. at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
  7. at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1240)
  8. at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:875)
  9. at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
  10. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  11. at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
  12. at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
  13. at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
  14. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  15. at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
  16. at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
  17. at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
  18. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  19. at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)
  20. at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
  21. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
  22. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
  23. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
  24. at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
  25. at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
  26. at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  27. at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  28. at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  29. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  30. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  31. at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
  32. at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
  33. at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
  34. at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
  35. at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
  36. at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
  37. at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1243)
  38. at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
  39. at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
  40. at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  41. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
  42. at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
  43. at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  44. at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
  45. at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  46. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  47. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  48. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
  49. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  50. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  51. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  52. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  53. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  54. at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  55. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  56. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  57. at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  58. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  59. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  60. at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
  61. at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  62. at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  63. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  64. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  65. at java.lang.Thread.run(Thread.java:745)
  66. [DEBUG] 2016-10-16 21:32:47,322 method:org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:991)
  67. Could not complete request
  68. org.apache.jasper.JasperException: /WEB-INF/jsp/list.jsp (line: 35, column: 16)
  69. <span style="color:#FF0000;">According to TLD or attribute directive in tag file, attribute value does not accept any expressions</span>
  70. at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
  71. at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
  72. at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
  73. at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1240)
  74. at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:875)
  75. at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
  76. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  77. at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
  78. at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
  79. at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
  80. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  81. at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
  82. at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
  83. at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
  84. at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  85. at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)
  86. at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
  87. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
  88. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
  89. at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
  90. at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
  91. at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
  92. at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  93. at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  94. at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  95. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  96. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  97. at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
  98. at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
  99. at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
  100. at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
  101. at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
  102. at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
  103. at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1243)
  104. at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
  105. at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
  106. at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  107. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
  108. at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
  109. at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  110. at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
  111. at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  112. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  113. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  114. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
  115. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  116. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  117. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  118. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  119. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  120. at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  121. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  122. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  123. at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  124. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  125. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  126. at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
  127. at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  128. at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  129. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  130. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  131. at java.lang.Thread.run(Thread.java:745)
  132. [DEBUG] 2016-10-16 21:32:47,323 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
  133. Returning cached instance of singleton bean 'sessionFactory'
  134. 十月 16, 2016 9:32:49 下午 org.apache.catalina.startup.HostConfig deployDirectory
  135. 信息: Deploying web application directory F:\tomcat\webapps\manager



意思是 没有加载tld文件  或者表达式没有匹配值

我用的web.xml 是3.1版   而且 jsp是2.0版   相关依赖坐标如下




  
  1. <!--jstl标签库依赖-->
  2. <!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
  3. <dependency>
  4. <groupId>javax.servlet</groupId>
  5. <artifactId>jstl</artifactId>
  6. <version>1.2</version>
  7. </dependency>
  8. <dependency>
  9. <groupId>taglibs</groupId>
  10. <artifactId>standard</artifactId>
  11. <version>1.1.2</version>
  12. </dependency>
  13. <!--jsp servlet相关依赖-->
  14. <dependency>
  15. <groupId>javax.servlet</groupId>
  16. <artifactId>javax.servlet-api</artifactId>
  17. <version>3.0.1</version>
  18. <scope>provided</scope>
  19. </dependency>
  20. <dependency>
  21. <groupId>javax.servlet.jsp</groupId>
  22. <artifactId>jsp-api</artifactId>
  23. <version>2.2</version>
  24. <scope>provided</scope>
  25. </dependency>


  
  1. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  2. 信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
  3. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  4. 信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
  5. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  6. 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
  7. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  8. 信息: TLD skipped. <span style="color:#FF0000;">URI: http://java.sun.com/jstl/fmt_rt is already defined</span>
  9. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  10. 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
  11. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  12. 信息: TLD skipped. <span style="color:#FF0000;">URI: http://java.sun.com/jsp/jstl/fmt is already defined</span>
  13. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  14. 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
  15. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  16. 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
  17. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  18. 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
  19. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  20. 信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
  21. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  22. 信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
  23. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  24. 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
  25. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  26. 信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
  27. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  28. 信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
  29. 十月 16, 2016 9:32:40 下午 org.apache.catalina.startup.TaglibUriRule body
  30. 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
  31. 十月 16, 2016 9:32:43 下午 org.apache.jasper.compiler.TldLocationsCache tldScanJar

红字显示fmt 标签的uri已经定义了

<span style="color:#FF0000;">http://java.sun.com/jsp/jstl/fmt 对应</span>
 


<span style="color:#FF0000;">http://java.sun.com/jsp/jstl/fmt_rt 对应</span>
 


感觉是兼容性的问题   就用

<span style="color:#FF0000;"></span><pre style="background-color:#333333;color:#ffffff;font-family:'Source Code Pro';font-size:12.0pt;"><%@ <span style="color:#fe6600;font-weight:bold;">taglib </span><span style="color:#cdb1ad;">prefix</span>="<span style="color:#66fe00;">fmt</span>" <span style="color:#cdb1ad;">uri</span>="<span style="color:#66fe00;">http://java.sun.com/jstl/fmt_rt</span>" %>
 



文章来源: felord.blog.csdn.net,作者:码农小胖哥,版权归原作者所有,如需转载,请联系作者。

原文链接:felord.blog.csdn.net/article/details/52833329

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。