JSP - Package not found
I just installed tomcat 6 on my server with Apache.
My jsp file return the following error:
Only a type can be imported. x.y.Z resolves to a package
In the source file, I have the following line:
<%@ page language="java" import=开发者_Go百科"x.y.Z" %>
I have checked on the Internet, and from what I understood, Tomcat can not find my class Z However, I have my Z.class file in /website/WEB-INF/classes/x/y/Z.class
In /etc/tomcat6/Catalina/www.mydomain.com/, I have in the ROOT.xml file:
< Context path="/website/" antiResourceLocking="false" />
The file /etc/tomcat6/server.xml contains:
<Host name="www.mydomain.com" appBase="/home/user/www/" unpackWARs="true" autoDeploy="true"> <Context path="/" docBase="./" debug="1" reloadable="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/tomcat6" prefix="tomcat_access_" suffix=".log" pattern="common" resolveHosts="false"/> </Host>
(/home/user/www/website/ is where my jsp files are stored)
I have tried to define a servlet in my web.xml file in WEB-INF but it didn't help. I have tried to move WEB-INF in / but it did not solve anything.
Any idea about why my Tomcat can't find my class?
Thanks for your help : )
I eventually solved my problem.
The architecture of the WEB-INF was ok, but it was not properly placed. I wrote an article about it with my configuration here
精彩评论