Note that there are some explanatory texts on larger screens.

plurals
  1. POJSP/Tomcat development: Does intellij idea automatically move packages to web-inf folder?
    primarykey
    data
    text
    <p>I am having a problem with errors such as:</p> <pre><code> HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 9 in the generated java file Only a type can be imported. com.test.util.ConnectionManager resolves to a package An error occurred at line: 31 in the jsp file: /test.jsp EmployeeDAO cannot be resolved to a type 28: &lt;td&gt;Job Title&lt;/td&gt; 29: &lt;td&gt;Hire Date&lt;/td&gt; 30: &lt;/tr&gt; 31: &lt;% EmployeeDAO em = new EmployeeDAO(); 32: Connection ct = ConnectionManager.getInstance().getConnection(); 33: ResultSet rs = em.selectByFirstNameRS(empN,ct); 34: try { An error occurred at line: 31 in the jsp file: /test.jsp EmployeeDAO cannot be resolved to a type 28: &lt;td&gt;Job Title&lt;/td&gt; 29: &lt;td&gt;Hire Date&lt;/td&gt; 30: &lt;/tr&gt; 31: &lt;% EmployeeDAO em = new EmployeeDAO(); 32: Connection ct = ConnectionManager.getInstance().getConnection(); 33: ResultSet rs = em.selectByFirstNameRS(empN,ct); 34: try { An error occurred at line: 32 in the jsp file: /test.jsp ConnectionManager cannot be resolved 29: &lt;td&gt;Hire Date&lt;/td&gt; 30: &lt;/tr&gt; 31: &lt;% EmployeeDAO em = new EmployeeDAO(); 32: Connection ct = ConnectionManager.getInstance().getConnection(); 33: ResultSet rs = em.selectByFirstNameRS(empN,ct); 34: try { 35: if(rs != null) {%&gt; An error occurred at line: 53 in the jsp file: /test.jsp ConnectionManager cannot be resolved 50: } catch (Exception e) { 51: e.printStackTrace(); 52: } finally { 53: ConnectionManager.getInstance().releaseConnection(ct); 54: }%&gt; 55: &lt;/table&gt; 56: &lt;a href="index.html"&gt;Return to search&lt;/a&gt; Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:321) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs. -------------------------------------------------------------------------------- Apache Tomcat/6.0.33 </code></pre> <p>I was looking through google and it may be caused by not having packages inside the WEB-INF folder. I am running <code>tomcat</code> through <code>IntelliJ</code> IDEA and I'm wondering shouldn't it move packages that are already in the filepath to the created <code>WEB-INF</code> folder on its own? And if it does, what am I doing wrong? This is the two files I'm using:</p> <p>index.html:</p> <pre><code> &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Employee Test Webapp&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h3&gt;Employee Database:&lt;/h3&gt; &lt;table&gt; &lt;tr&gt; What is the name of the Employee you want to find? &lt;/tr&gt; &lt;tr&gt; &lt;form action="test.jsp" method="post"&gt; &lt;td&gt;&lt;input type="text" name="empName"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" value="search"&gt;&lt;/td&gt; &lt;/form&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And test.jsp:</p> <pre><code>&lt;%@ page import="com.sun.xml.internal.ws.wsdl.writer.document.xsd.Import" %&gt; &lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt; &lt;%@ page import="com.test.dao.*" %&gt; &lt;%@ page import="java.sql.Connection" %&gt; &lt;%@ page import="com.test.util.ConnectionManager" %&gt; &lt;%@ page import="java.sql.ResultSet" %&gt; &lt;% String empN = request.getParameter("empName"); %&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;Employee Test Web App&lt;/title&gt;&lt;/head&gt; &lt;body&gt; Your results are: &lt;table cellpadding="15" border="1" style="background-color: #ffffcc;"&gt; &lt;tr&gt; &lt;td&gt;Employee ID&lt;/td&gt; &lt;td&gt;First Name&lt;/td&gt; &lt;td&gt;Last Name&lt;/td&gt; &lt;td&gt;Company Name&lt;/td&gt; &lt;td&gt;Department Name&lt;/td&gt; &lt;td&gt;Job Title&lt;/td&gt; &lt;td&gt;Hire Date&lt;/td&gt; &lt;/tr&gt; &lt;% EmployeeDAO em = new EmployeeDAO(); Connection ct = ConnectionManager.getInstance().getConnection(); ResultSet rs = em.selectByFirstNameRS(empN,ct); try { if(rs != null) {%&gt; &lt;%while (rs.next()) {%&gt; &lt;tr&gt; &lt;td&gt;&lt;%=rs.getInt(1)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(2)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(3)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(4)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(5)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(6)%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=rs.getString(7)%&gt;&lt;/td&gt; &lt;/tr&gt;&lt;% } }else{ %&gt; &lt;tr&gt;Table empty&lt;/tr&gt; &lt;% } } catch (Exception e) { e.printStackTrace(); } finally { ConnectionManager.getInstance().releaseConnection(ct); }%&gt; &lt;/table&gt; &lt;a href="index.html"&gt;Return to search&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Some imports Idea made on its own. Here's my filepath:</p> <p><a href="http://i.imgur.com/iJd8H.png" rel="nofollow">http://i.imgur.com/iJd8H.png</a></p> <p>Please help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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