开发者

How to deploy servlets to a share Tomcat instance?

开发者 https://www.devze.com 2023-01-19 01:13 出处:网络
I\'ve created a servlet app using Netbeans and it works on my local machine.Now I need to deploy the app to my college class Tomcat 6 开发者_运维技巧instance.The instance is set up like so: /java/tomc

I've created a servlet app using Netbeans and it works on my local machine. Now I need to deploy the app to my college class Tomcat 6 开发者_运维技巧instance. The instance is set up like so: /java/tomcat/webapps/<student_id>, where student_id are the 30 student IDs for my class.

What exactly do I need to deploy to /java/tomcat/webapps/elvin in order to get my servlets to work? I don't have root access to this machine and I can only write to /java/tomcat/webapps/elvin.

Thanks.


Easiest would be to let Netbeans create/build a WAR file (there should be one in project's /dist folder) and then extract it locally using some ZIP tool and finally copy the extracted contents unchanged into /webapps/elvin.

Several things to check:

  • Servlet classes should go in a package. Packageless servlets will fail in certain configurations. Java classes should go in a package anyway.
  • The Servlet version as declared in web.xml must be supported by Tomcat version in question.
    • Tomcat 7.0 supports max Servlet 3.0
    • Tomcat 6.0 supports max Servlet 2.5
    • Tomcat 5.5 supports max Servlet 2.4
    • Tomcat 5.0 supports max Servlet 2.3.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号