Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download servlet 3 dependency that works with tomcat 7

i was using servlet 2.5 as follows:

<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
</dependency>

and i want to use servlet 3 since i am migrating to tomcat 7 so i can use EL 2.2, when i added the following dependency, it couldn't be found:

<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0</version>
        <scope>provided</scope>
</dependency>

UPDATE:

I am using Spring 3, JSF 2, Tomcat 7

so what do you guys suggest ?

like image 313
Mahmoud Saleh Avatar asked Oct 17 '11 15:10

Mahmoud Saleh


2 Answers

Looks like artifact ID has been renamed to javax.servlet-api

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

Here is the search URL on maven central: http://search.maven.org/#search|gav|1|g%3A%22javax.servlet%22

To preempt your question about JSP and EL, here are the dependencies for jsp-api and el-api:

<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>javax.servlet.jsp-api</artifactId>
    <version>2.2.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.el</groupId>
    <artifactId>javax.el-api</artifactId>
    <version>2.2.2</version>
    <scope>provided</scope>
</dependency>
like image 199
Alexander Pogrebnyak Avatar answered Nov 12 '22 15:11

Alexander Pogrebnyak


The library org.apache.tomcat contains Servlet 3.0

<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-servlet-api</artifactId>
    <version>7.0.30</version>
    <scope>provided</scope>
</dependency>

For further reference see:

  1. https://github.com/SpringSource/spring-mvc-showcase/blob/master/pom.xml
  2. https://github.com/SpringSource/spring-mvc-showcase/blob/master/src/main/webapp/WEB-INF/web.xml
like image 34
user2601995 Avatar answered Nov 12 '22 13:11

user2601995