jasperexception
很是气愤怎么之前写的简单的javabean的例子老是显示无法编译,而且配置啥的都没问题就是简单的几行代码 就是找不到错。
错误显示:
org.apache.jasper.JasperException: 无法编译JSP
Only a type can be imported. demo.j2ee.demo1.Regdemo resolves to a package
An error occurred at line: 3 in the jsp file: /register/WebRoot/test.jsp
Generated servlet error:
Regdemo cannot be resolved to a type
An error occurred at line: 3 in the jsp file: /register/WebRoot/test.jsp
Generated servlet error:
Regdemo cannot be resolved to a type
简单的源码:
jsp:
<%@ page import="indi.gao.javabean" %>
<%
javabean i=new javabean();
i.setName("sdf");
%>
<%
out.print(i.getName());
%>
bean:
package indi.gao;
public class javabean {
private String name;
public javabean()
{
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
解决方法:
本人用的是 Eclipse
在菜单栏中 project 下拉选项 build Automaticlly 打对勾就行了
原因:class文件无法编译
相关阅读
org.apache.jasper.JasperException: org.apache.jasp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 标签飘红 直接切入主题,网上说了很多解决办法,什么缺少j