title: Gradle finds the Servlet library but not JSP, i.e. javax.servlet.jsp.tagext. How to import?
body: <p>I'm trying to migrate my web-app to Gradle from Eclipse. I was getting errors about my Websockets, custom tags and jsp. Wishing I'd started with Gradle I made a MWE based on <a href="http://codetutr.com/2013/03/23/simple-gradle-web-application/" rel="nofollow noreferrer">http://codetutr.com/2013/03/23/simple-gradle-web-application/</a></p>
  
  <p>build.gradle (I commented out the third line, and another about jetty, really trying for MWE, which it <em>was</em> until I needed the jsp stuff)</p>
  
  <pre><code>apply plugin: 'java' 
  apply plugin: 'war' 
  //apply plugin: 'eclipse-wtp' //I want Gradle to be IDE agnostic, if not portable.
  
  repositories {
    mavenCentral()
  }
  
  dependencies {
  //  providedCompile 'javax.servlet:servlet-api:2.5'
    providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
    runtime 'javax.servlet:jstl:1.2'//.1
  }
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
    &lt;servlet&gt;
  &lt;display-name&gt;HelloWorldServlet&lt;/display-name&gt;
  &lt;servlet-name&gt;HelloWorldServlet&lt;/servlet-name&gt;
  &lt;servlet-class&gt;com.codetutr.HelloWorldServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;HelloWorldServlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>HelloWorldServlet</p>
  
  <pre><code>package com.codetutr;
  
  import java.io.IOException;
  
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  public class HelloWorldServlet extends HttpServlet {
  
  private static final long serialVersionUID = 1L;
  
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)  
      throws ServletException, IOException {
      resp.getOutputStream().write("Hello World.".getBytes());
  }
  } 
  </code></pre>
  
  <p>That is as far as the tutorial goes so I added MyTagHandler.java</p>
  
  <pre><code>  package com.codetutr;
  
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    import java.io.*;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.Map;
  
    public class MyTagHandler extends SimpleTagSupport {
  
        private static Map&lt;String, String&gt; tagDB = Collections.synchronizedMap(new HashMap&lt;&gt;());
        private static int iter_cnt = 0;
  
        public void doTag() throws JspException, IOException {
            tagDB.put(Integer.toString(iter_cnt), "Dumb Tag");
            JspWriter out = getJspContext().getOut();
            out.println("&lt;h2&gt;Progress&lt;/h2&gt;&lt;table border=\"1\"&gt;");
            out.println("&lt;tr&gt;&lt;th&gt;Id&lt;/th&gt;&lt;th&gt;State&lt;/th&gt;&lt;/tr&gt;");
            for (Map.Entry&lt;String, String&gt; entry : tagDB.entrySet()) {
            String value = entry.getValue();
            out.println("&lt;tr&gt;&lt;th&gt;"+ entry.getKey() + "&lt;/th&gt;&lt;td&gt;"
                    + value + "&lt;/td&gt;&lt;/tr&gt;");
            }
            out.println("&lt;/table&gt;");
        }
    }
  </code></pre>
  
  <p>I get the following errors from <code>gradle.build</code></p>
  
  <pre><code>basic-web/src/main/java/com/codetutor/MyTagHandler.java:3: error: package javax.servlet.jsp.tagext does not exist
  import javax.servlet.jsp.tagext.*;
  
  basic-web/src/main/java/com/codetutor/MyTagHandler.java:4: error: package javax.servlet.jsp does not exist
  import javax.servlet.jsp.*;
  
  basic-web/src/main/java/com/codetutor/MyTagHandler.java:10: error: cannot find symbol
  public class MyTagHandler extends SimpleTagSupport {
  </code></pre>
  
  <p>and so on for errors where classes aren't imported properly.</p>
  
  <p><a href="https://stackoverflow.com/questions/24262223/standard-way-of-adding-jslt-1-2-1-in-a-maven-project">Standard way of adding JSLT 1.2.1 in a Maven Project?</a> is the closest q:a I could find.
  I was, and will be using Tomcat (8.5) if it matters.</p>