Tomcat 6 conversion to Glassfish v3: servlet-api, el-api jars

后端 未结 1 1620
故里飘歌
故里飘歌 2021-01-07 13:51

I used ant when building my web app from eclipse to deploy to Tomcat 6 and referred to servlet-api.jar and el-api.jar within the Tomcat 6 release t

相关标签:
1条回答
  • 2021-01-07 14:51

    Seeing this question and the other questions you posted I have the feeling that you're doing things completely wrong. Here's just an answer which should get it all straight.

    • You should never have separate copies of servletcontainer-specific libraries wandering around in the classpath.

    • You should never put copies of servletcontainer-specific libraries in webapplication's WEB-INF/lib.

    • In an IDE like Eclipse, you should never add servletcontainer-specific libraries separately in project's build path.

    • In a nut: just do not touch servletcontainer-specific libraries at all. Don't even think of downloading them separately. That's plain recipe for trouble. Having separate libraries of different servletcontainer makes will only result in collisions in classpath. The servletcontainer should be downloaded and treated as its whole own.

    • In Eclipse, when integrating a servletcontainer (Tomcat or Glassfish), just add it in the Servers view.

    • To associate a dynamic web project with a specific servletcontainer (server) so that you can compile servlets and so on, you need to select it in the Targeted Rumtimes section of the project properties. Then everything will go well automagically, thanks to Eclipse smartness. That's also the place to change the servletcontainer implementation whenever necessary. When you're creating a brand new dynamic web project, you can just choose the desired servletcontainer implementation from the servers dropdown in the wizard.

    When you want to create a WAR, simply rightclick the dynamic web project, choose Export and then WAR file. No need for a separate ant task or so.

    0 讨论(0)
提交回复
热议问题