考虑:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 10 in the jsp file: /index.jsp
Mybean cannot be resolved to a type
7: <title></title>
8: </head>
9: <body>
10: <jsp:useBean id="bean1" class="Mybean"/>
11: <jsp:setProperty name="bean1"
12: property="name"
13: value="bean1" />
An error occurred at line: 17 in the jsp file: /index.jsp
Mybean cannot be resolved to a type
14: <jsp:setProperty name="bean1"
15: property="id"
16: value="1" />
17: <jsp:getProperty name="bean1" property="name" />
18: <jsp:getProperty name="bean1" property="id" />
19:
20: </body>
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:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
我制作了一个带有 Mybean 名称的 Java 类。我正在使用 JSP 来设置属性和获取属性。我收到一个我无法解决的错误。