How to download servlet 3 dependency that works with tomcat 7

Mahmoud Saleh picture Mahmoud Saleh · Oct 17, 2011 · Viewed 15.7k times · Source

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 ?

Answer

Alexander Pogrebnyak picture Alexander Pogrebnyak · Oct 17, 2011

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>