I'm learning how to make a servlet 3.1 compliant webapp, that will run on JBoss wildfly 10. I use maven for dependencies, and I'm unsure what the following dependencies do exactly, and if they are included/not included in the servlet container:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
I already did some googling and would like verification or completion of the following information:
- The servlet api is provided by the servlet container, so I can add
<scope>provided</scope>
in Maven. However, why do I need to include this jar? Which classes or files will have errors when I remove it? - I'm not sure what javax.servlet.jsp-api does. My hello world example seems to run just fine if I don't include it. What does this do? And do I need to add
<scope>provided</scope>
or not? - The JSTL is not provided by any servlet container, so it must be explicitly added. This jar ensures that the
<c:xxx>
and other basic tags are processed correctly in my jsp's.