Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么JSP中的void构造函数返回错误?_Java_Jsp - Fatal编程技术网

Java 为什么JSP中的void构造函数返回错误?

Java 为什么JSP中的void构造函数返回错误?,java,jsp,Java,Jsp,这是主代码 <%@page import="Escola.Disciplina"%> <%@page import="java.util.ArrayList"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head>

这是主代码

<%@page import="Escola.Disciplina"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            Disciplina disciplina = new Disciplina();
        %>
   
    </body>
</html>

但是当我试着跑的时候,那东西出现了

java.lang.RuntimeException: 
    Escola.Disciplina.<init>(Disciplina.java:1)
    org.apache.jsp.salvarDisciplina_jsp._jspService(salvarDisciplina_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
java.lang.RuntimeException:
Districta.(stricta.java:1)
salvarDisciplina\u jsp.\u jsp服务(salvarDisciplina\u jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
javaservlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javaservlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
当我在inspector中单击查看时,他们说错误出现在第1行,即Districta类的“package Escola”。你们知道为什么会这样吗

java.lang.RuntimeException: 
    Escola.Disciplina.<init>(Disciplina.java:1)
    org.apache.jsp.salvarDisciplina_jsp._jspService(salvarDisciplina_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)