HTTP Status 500 - Unable to compile class for JSP:Duplicate local variable xxx

jsp页面中使用了:<% String title = com.xunge.base.constant.PlatInfo.title; %> ,由于一个页面中引用的多个jsp页面中都包含该语句,那么就会出现以下错误:

详细错误信息如下图:

解决该问题的方法:

方法一:

保证引用的页面中只有一个页面存在类似语句;

方法二:

参考:jsp页面中JSTL/EL标签引用java后台静态static字段的方法总结

时间: 2024-11-12 06:45:59

HTTP Status 500 - Unable to compile class for JSP:Duplicate local variable xxx的相关文章

【FAQ】HTTP Status 500 - Unable to compile class for JSP:&#39;***&#39; cannot be resolved to a type

1.问题现象 2.解决方法 原因分析:cannot be resolved to a type 基本上是该类没有被识别出来,编译的时候,编译路径下没有该类对应的库文件, 可以通过下面几步解决: 1.拷贝类对应的jar到tomcat lib目录下:C:\Program Files\Java\apache-tomcat-8.0.9\lib 1.关闭tomcat服务器:执行bat文件 C:\Program Files\Java\apache-tomcat-8.0.9\bin\shutdown.bat

HTTP Status 500 - Unable to compile class for JSP:Syntax error on token &quot;=&quot;, @ expected

jsp页面中使用<% = com.xunge.base.constant.PlatInfo.title %>取静态字段的值,报HTTP Status 500 - Unable to compile class for JSP:Syntax error on token "=", @ expected错误. 详细错误信息如下: 在网上搜索了很久也没找到解决方法,后来发现是因为"<% ="百分号和等号之间多了一个空格的原因,去掉就OK了.

jsp调用javabean出现错误HTTP Status 500 - Unable to compile class for JSP

HTTP Status 500 - Unable to compile class for JSP: type Exception report message Unable to compile class for JSP: description The server encountered an internal error that prevented it from fulfilling this request. exception org.apache.jasper.JasperE

maven用框架编写网页运行出现HTTP Status 500 - Unable to compile class for JSP

利用maven整合框架的时候,通过浏览器访问时,如果出现  HTTP 500-Unable to compile class for JSP 的错误,应该怎么解决呢? 之前在网上看了好多人的解决方案.都不合适我,最后我发现在一个maven视频里面看到的.maven里的pom.xml把tomcat改成只读就好了,因为导入的jar和tomact自带的有冲突 这样改就可以正常的访问所写的项目了 我在整理几项其余的HTTP 500-Unable to compile class for JSP 的错误

运行ssh项目出现&quot;HTTP Status 500 - Unable to instantiate Action&quot;

开始整合ssh框架报的错: HTTP Status 500 - Unable to instantiate Action, employeeAction, defined for 'show' in namespace '/'Error creating bean with name 'employeeAction' defined in file [E:\javaTools\apache-tomcat-8.0.15\webapps\ssh\WEB-INF\classes\bean-action

解决 HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException:

HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> msg [in template "org/apache/struts2/dispatcher/error.ftl" at line 68, column 31] Tip: If the fail

Message Unable to compile class for JSP

使用 UniEAPWorkshop_5.0运行4.6 的代码,流程新建时出现的错误 JDK 使用C:\Program Files (x86)\Java\jdk1.7.0_80 tomcat使用 apache-tomcat-7.0.91   改成apache-tomcat-6.0.41 解决! HTTP Status 500 – Internal Server Error ---------------------------------------------------------------

Count:858org.apache.jasper.JasperException: Unable to compile class for JSP

1.错误描述 Count:858org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 12 in the jsp file: /resource/pages/storageTankQuery/storageTankInfo/storageTankInfo.jsp basePath cannot be resolved to a variable 9: // 璺

org.apache.jasper.JasperException: Unable to compile class for JSP

部署war时,遇到下面异常: exception org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328