简体   繁体   中英

Can WEB-INF be at a subdirectory JSP Tomcat6

I have an JSP application, it is under server/a/b and WEB-INF is under server/a/b/WEB-INF, not at the app-root directory.

Now I get an error saying the package P does not exisit when visiting server/a/b/index.jsp. Actually the package exists and it is at server/a/b/WEP-INF/classes/P/

I want to know whether the error is due to not-at-root-directory?

Thanks!

Your server/a/b example is too ambiguous to reasonably answer the question.

At least, it should be the immediate subdirectory of the webapplication context folder. In Tomcat, all webapplications are to be placed in its own folder in the /tomcat/webapps folder where /tomcat is the Tomcat installation folder. The /webapps folder should be already there when you installed Tomcat. Each deployed webapp should be placed in its own folder /webappname which contains the webapplication context which is to be reached by http://hostname:port/webappname .

So, the /WEB-INF folder should be in /tomcat/webapps/webappname/WEB-INF . Not anywhere else. It would contradict the Servlet API specification .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM