title: jsp including CSS&JS <%@ include %> vs <script>
body: <p>JSP is new to me, and I would like to know exactly the difference between these 2 tags when it comes to importing a <strong>JS</strong> or <strong>CSS</strong> file.</p>
  
  <p>What I've tested is we can use both of them for including files in the JSP.</p>
  
  <p>But with </p>
  
  <pre><code>&lt;script src = "../js/someJavaScript.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>the file must be <strong>out of</strong> the <code>WEB-INF</code> folder, while with</p>
  
  <pre><code>&lt;%@include file = "../js/someJavaScript.js"%&gt;
  </code></pre>
  
  <p>I can access the js file <strong>in</strong> the WEN-INF folder, but when I tried to include the <code>jquery-library</code>,
  I got this error:</p>
  
  <pre><code>org.apache.jasper.JasperException: Impossible de compiler la classe pour la JSP: 
  
  An error occurred at line: 56 in the generated java file
  The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
  
  Stacktrace:
      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
      at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:443)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
      at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>Does the <strong>CSS</strong> &amp; <strong>JS</strong> file has to be outside of the <code>WEB-INF</code> folder?</p>
  
  <p>And I know there are also <code>&lt;%@include file="../../*.jsp"/&gt;</code> and <code>&lt;jsp:include page="../../*.jsp"/&gt;</code>
  for including another jsp.</p>
  
  <p>Can someone explain the differences?</p>