当前位置: 技术问答>java相关
20分的小问题(JSP文件使用类发生错误),在线等!!!
来源: 互联网 发布时间:2015-10-27
本文导语: JSP文件内容如下: ------------------------ JSP02 --------------------------- 运行产生错误提示: org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. ..worklocalhost__0002ftest_0002fm_00030_00...
JSP文件内容如下:
------------------------
JSP02
---------------------------
运行产生错误提示:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:58: Identifier expected.
a=10;
^
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:61: 'try' without 'catch' or 'finally'.
Redhat myredhat=new Redhat();
^
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:75: Type expected.
} catch (Throwable t) {
^
3 errors, 1 warning
------------------------------
------------------------
JSP02
---------------------------
运行产生错误提示:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:58: Identifier expected.
a=10;
^
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:61: 'try' without 'catch' or 'finally'.
Redhat myredhat=new Redhat();
^
..worklocalhost__0002ftest_0002fm_00030_00032_0002ejspm02_jsp_3.java:75: Type expected.
} catch (Throwable t) {
^
3 errors, 1 warning
------------------------------
|
你这样是不是想输出class Redhat a的值啊。
这样是不行的,因为你的a 是int ,你想类型转换不是这样的。
只能是out.print(String.valueOf(myredhat.a));
又或者你直接把这个东西输出就可以了,不用什么类型转换了
out.print(myredhat.a);
这样是不行的,因为你的a 是int ,你想类型转换不是这样的。
只能是out.print(String.valueOf(myredhat.a));
又或者你直接把这个东西输出就可以了,不用什么类型转换了
out.print(myredhat.a);