Where do I get servlet-api.jar from?

Deadly 提交于 2019-12-30 03:45:05

问题


In order to write servlets code I need servlet-api.jar. Where do i get servlet-api.jar from ?


回答1:


Make sure that you're using the same Servlet API specification that your Web container supports. Refer to this chart if you're using Tomcat: http://tomcat.apache.org/whichversion.html

The Web container that you use will definitely have the API jars you require.

Tomcat 6 for example has it in apache-tomcat-6.0.26/lib/servlet-api.jar




回答2:


Grab it from here

Just choose required version and click 'Binary'. e.g direct link to version 2.5




回答3:


You may want to consider using Java EE, which includes the javax.servlet.* packages. If you require a specific version of the servlet api, for instance to target a specific web application server, you will probably want the Java EE version which matches, see this version table.




回答4:


You can find a recent servlet-api.jar in Tomcat 6 or 7 lib directory. If you don't have Tomcat on your machine, download the binary distribution of version 6 or 7 from http://tomcat.apache.org/download-70.cgi



来源:https://stackoverflow.com/questions/8521851/where-do-i-get-servlet-api-jar-from

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!