java中的方法在jsp中报错,在java中建了个主方法测试可以用,但是一旦在jsp中调用就报错
org.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerroroccurredatline:14...
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 147 in the jsp file: /index.jspThe method print(boolean) in the type JspWriter is not applicable for the arguments (void)144: <dl>145: <dd>146: <% SocketPro sp=new SocketPro();%>147: <%=sp.open() %>148: <%=sp.getLaLo() %>149: </dd>150: </dl>An error occurred at line: 148 in the jsp file: /index.jspThe method print(boolean) in the type JspWriter is not applicable for the arguments (void)145: <dd>146: <% SocketPro sp=new SocketPro();%>147: <%=sp.open() %>148: <%=sp.getLaLo() %>149: </dd>150: </dl>151: </div>后来有用了一个测试类,就写了个方法里面放了个打印,还是报错
注:已经导入包了 展开
注:已经导入包了 展开
1个回答
2016-07-21
展开全部
报错那肯定有错误提示,java.util里面的类必须在jsp中导入才能用。人家的页面代码没看见显示导入,说不定人家用了隐式导入,比如<jsp:include page这样加了公共的导入页面,你没发现人家的入口而已。你现在报错无非是双重导入或者刚下载下来jre包路径有问题,或者跟别人不是一样的路径而已。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询