TomExam_v2.1_UTF8访问jsp时报错:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 8 in the generated java file
Only a type can be imported. com.tom.cache.ConfigCache resolves to a package
发现WEB-INF\classes下并没有类而是打tomexam.jar包放在了WEB-INF\lib下
解决办法:
在%CATALINA_HOME%\conf\server.xml的虚拟主机中通过Context子元素指定其Root Context所在位置:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/TomExam_v2.1_UTF8" docBase="D:\dev_tools\apache-tomcat-6.0.32\webapps\TomExam_v2.1_UTF8\WebRoot" reloadable="true" />
</Host>
只要加多个context就可以了,其中path为访问路径,docBase为项目文件根目录所在。这样应用的文件路径通过docBase来指定,这样就能在WEB-INF的lib载到包找到类了。
分享到:
相关推荐
不导入mail.jar会发生 An error occurred at line: 6 in the generated java file Only a type can be imported. javax.mail.Session resolves to a package
and one of the feature of OOP in java is that, we can assign a subclass object or variable to the variable of the superclass type. Log files Log files keeps a records of internet protocol addresses...
A large number of Hypothesis events will be generated while only one Recognition and EndStream events will be associated with a particular recognition attempt. The sample provides a standard file ...
DNSKEY to be imported into the DNSKEY management framework. [RT #34698] Check that EDNS subnet client options are well formed. [RT #34718] "named" now preserves the capitalization of names when ...
- Debug privilege is now managed and damaged PDB can be repaired (Thanks to EliCZ) - Renormalized exports (for Win9x/ME only) - Fixed a GPF when using the wheel mouse (or arrows keys) just after ...
Starting from now, the components can be used by RAD Studio form designer in 64-bit projects. The basic socket components were replaced and improved. The class inheritance was changed. Please see the...