Search code examples
javajspmavenjakarta-eejstl

What maven dependencies needs for Servlet, JSP and JSTL in Java EE 7?


I want use SDK Java EE 7, Glassfish 4 and Maven.
Is it correct? Please, draw attention to scopes.

1. For servlets:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>
    <scope>provided</scope>
</dependency>

2. JSP without standart tags and without JSTL:

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>jsp-api</artifactId>
  <version>2.0</version>
</dependency>

3. For JSP with standard tags "c:"

<dependency>
    <groupId>taglibs</groupId>
    <artifactId>standard</artifactId>
    <version>1.1.2</version>
</dependency>

4. For JSP with JSTL

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
    <scope>runtime</scope>
</dependency>

Do you know specification where this information contains?


Solution

  • You shouldn't be adding these dependencies to your project. Instantiations of the J2EE specification such as servlets should be provided by the application server's runtime.

    In Eclipse, To add the Server Runtime for your application server. Right click the project and select Properties. Then Build Path > Add Library > Server Runtime.