当前位置: 技术问答>java相关
JavaBean+jsp+Tomcat4.0???把我搞醉了
来源: 互联网 发布时间:2015-03-06
本文导语: 在Jsp中调用testbean类,在Tomcat4.0下Webapps目录下,新建testdir目录->jsp和classes目录,把jsp1.jsp文件放到jsp目录下,testbean类放到classes目录中,同时设置环境变量CLASSPATH=D:Tomcat 4.0webappstestdirclasses.为什么在浏览器中运行,总...
在Jsp中调用testbean类,在Tomcat4.0下Webapps目录下,新建testdir目录->jsp和classes目录,把jsp1.jsp文件放到jsp目录下,testbean类放到classes目录中,同时设置环境变量CLASSPATH=D:Tomcat 4.0webappstestdirclasses.为什么在浏览器中运行,总是D:Tomcat 4.0worklocalhosttestdirjspJsp1$jsp.java:70: 找不到类 beantest.testbean。beantest.testbean JBI = null为什么?而在Jbuild5中可以Run的.
|
你把环境变量CLASSPATH=D:Tomcat 4.0webappstestdirclasses加到TOMCAT安装目录下的bincatalina.bat的文件中,找到“Set Up The Runtime Classpath ”。就象下面一样试试看!
rem ----- Set Up The Runtime Classpath ----------------------------------------
set CP=%CATALINA_HOME%binbootstrap.jar;%JAVA_HOME%libtools.jar
if "%JSSE_HOME%" == "" goto noJsse
set CP=%CP%;%JSSE_HOME%libjcert.jar;%JSSE_HOME%libjnet.jar;%JSSE_HOME%libjsse.jar
:noJsse
set CLASSPATH=%CP%;D:Tomcat 4.0webappstestdirclasses;
echo Using CATALINA_BASE: %CATALINA_BASE%
echo Using CATALINA_HOME: %CATALINA_HOME%
echo Using CLASSPATH: %CLASSPATH%
echo Using JAVA_HOME: %JAVA_HOME%
rem ----- Set Up The Runtime Classpath ----------------------------------------
set CP=%CATALINA_HOME%binbootstrap.jar;%JAVA_HOME%libtools.jar
if "%JSSE_HOME%" == "" goto noJsse
set CP=%CP%;%JSSE_HOME%libjcert.jar;%JSSE_HOME%libjnet.jar;%JSSE_HOME%libjsse.jar
:noJsse
set CLASSPATH=%CP%;D:Tomcat 4.0webappstestdirclasses;
echo Using CATALINA_BASE: %CATALINA_BASE%
echo Using CATALINA_HOME: %CATALINA_HOME%
echo Using CLASSPATH: %CLASSPATH%
echo Using JAVA_HOME: %JAVA_HOME%
|
这样再试试!重新启动!在testdir下建个这样的目录WEB-INFclasses
set CLASSPATH=%CP%;D:Tomcat 4.0webappstestdirWEB-INFclasses;
set CLASSPATH=%CP%;D:Tomcat 4.0webappstestdirWEB-INFclasses;