当前位置: 技术问答>java相关
怎样在jsp中调用beans?多谢!!!
来源: 互联网 发布时间:2015-10-01
本文导语: 我在测试javamail,sendmail.jsp中是这样调用的 org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 1 in the jsp file: /sendmail.jsp Generated servlet error: D:...
我在测试javamail,sendmail.jsp中是这样调用的
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred at line: 1 in the jsp file: /sendmail.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail$jsp.java:56: Class mail.Email not found.
mail.Email sm = null;
^
An error occurred at line: 1 in the jsp file: /sendmial.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail2$jsp.java:59: Class mail.Email not found.
sm= (mail.Email)
^
An error occurred at line: 1 in the jsp file: /sendmail.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail$jsp.java:64: Class mail.Email not found.
sm = (mail.Email) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "mail.Email");
另:我用javac编译的Email.class;编译通过;我将Email.class放到testweb-infclasses下了
配置 win2000+tomcat4+j2sdk1.4.0
会不会还需要别的东西呢?
多谢大家!
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred at line: 1 in the jsp file: /sendmail.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail$jsp.java:56: Class mail.Email not found.
mail.Email sm = null;
^
An error occurred at line: 1 in the jsp file: /sendmial.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail2$jsp.java:59: Class mail.Email not found.
sm= (mail.Email)
^
An error occurred at line: 1 in the jsp file: /sendmail.jsp
Generated servlet error:
D:jakarta-tomcat-4.0.4workStandalonelocalhosttestsendmail$jsp.java:64: Class mail.Email not found.
sm = (mail.Email) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "mail.Email");
另:我用javac编译的Email.class;编译通过;我将Email.class放到testweb-infclasses下了
配置 win2000+tomcat4+j2sdk1.4.0
会不会还需要别的东西呢?
多谢大家!
|
你编译了么? 然后最好重启 就可以
用javac 编译 不会去查资料
对了 *.java要放在指定 位置 你可以搜索贴子 有好多
用javac 编译 不会去查资料
对了 *.java要放在指定 位置 你可以搜索贴子 有好多
|
*.java放到哪里无所谓,
*.class 可要注意。
看你的问题,好像是bean 没有找到呀 前面把mail.Email import 进来了吗?
*.class 可要注意。
看你的问题,好像是bean 没有找到呀 前面把mail.Email import 进来了吗?
|
class 放在:
jsp所在目录的
WEB-INFclasses里
jsp所在目录的
WEB-INFclasses里