Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It is the responsibility of the web application container to provide both the Servlet/JSP API and implementation files. With your current Maven setup you are causing these library files to be bundled in your app, which consequently causes the class loader problems you are seeing in your log.</p> <blockquote> <p>When trying to import packages such as javax.servlet.*; Eclipse complained that it does not have it inside its classpath (build path).</p> </blockquote> <p>Yes, you need the API libraries in your classpath in order to compile code that depends on them. You want to include these libraries on your <em>build</em> classpath, while at the same time not including them in the final deployable. You do this with Maven by identifying the <code>scope</code> of the dependent libraries as <code>provided</code>. Which basically means "these libraries are needed for compilation, but will eventually be provided by the app container, so don't actually include them in the deployable".</p> <blockquote> <p>Also, I can't seem to find the right versions for servlet-api 3.0 or jsp 2.2 in the maven repository</p> </blockquote> <p>The Servlet 3.0 and JSP 2.2 API's have been bundled in the common JavaEE Web API. This is the dependency that you need to specify in your POM. Illustrated:</p> <pre><code>&lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;javax&lt;/groupId&gt; &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt; &lt;version&gt;6.0&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload