Tomcat 6转换为Glassfish v3:servlet-api,el-api jars [英] Tomcat 6 conversion to Glassfish v3: servlet-api, el-api jars

查看:74
本文介绍了Tomcat 6转换为Glassfish v3:servlet-api,el-api jars的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在eclipse中构建我的web应用程序以部署到Tomcat 6时,我使用ant并引用 servlet-api.jar el-api。 jar 在Tomcat 6版本树中,而不是将它们拉入到我部署的库文件夹中。



我试图部署到Glassfish v3。我已经从www.java2s.com网站上取下了罐子。


  1. 这是找到它们的正确地点吗?

  2. 我是否需要这么做?我在Glassfish内进行了搜索,并且罐子不在那里

  3. 如果我完全不需要这样做,是否还有其他行为需要遵循以确保具有相同的功能?


解决方案

看到这个问题和其他 我觉得你正在做的事情完全错误。这只是一个应该得到它的答案。




  • 您应永不特定于servletcontainer的库在类路径中漫游。

  • 永远不要将webapplication的 WEB-INF / lib 。在像Eclipse这样的IDE中,您应该永远在项目的构建路径中分别添加servletcontainer特定的库。

    / li>
  • 坚果:只要不要完全接触servletcontainer特定的库。甚至不要单独下载它们。这是麻烦的普通配方。分离不同servlet容器的库会导致类路径中的冲突。在Eclipse中,当集成servlet容器(Tomcat或Glassfish)时,只需将它添加到 中即可。 >服务器视图。


  • 要将动态Web项目与特定的servlet容器(服务器)相关联以便编译servlet等,需要在项目属性的 Targeted Rumtimes 部分中选择它。然后,由于Eclipse的智能,一切都会自动进行。这也是在必要时更改servletcontainer实现的地方。当您创建全新的动态Web项目时,您只需从向导的服务器下拉列表中选择所需的servletcontainer实施即可。




当您要创建WAR时,只需右键单击动态Web项目,选择导出,然后选择 WAR文件。不需要单独的ant任务。


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 tree rather than pulling them in to my deployed library folder.

I am trying to deploy to Glassfish v3. I've pulled the jars from the www.java2s.com website.

  1. Was this the right place to get them?
  2. Did I need to do it at all? I searched within Glassfish and the jars weren't there
  3. If I didn't need to do it at all, is there another course of action to follow to ensure the same functionality is available?

解决方案

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.

这篇关于Tomcat 6转换为Glassfish v3:servlet-api,el-api jars的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆