(请问yysun)关于安装JSP的问题?(50分)

S

snows

Unregistered / Unconfirmed
GUEST, unregistred user!
我已经在大富翁论坛上下载了JDK,JSWDK,并且按照yysun写的文章安装、启动,但在浏览器中地址
栏中键入http://localhost:8080, 或者 http://127.0.01:8080 不能看到 JSWDK 的欢迎页?
在执行 startserver.bat后 提示如下:
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Using classpath: ;${sysJars}
运行stopserver.bat后,提示如下:
Exception in thread "main" java.lang.HoClassDefFoundError: com/sun/web/shell/Shutdown
请问如何解决?
 
C

cAkk

Unregistered / Unconfirmed
GUEST, unregistred user!
打开一个dos prompt窗口,选菜单"属性|内存|初始化环境",设置为"2186",
然后关闭,重新打开一个dos窗口运行server
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
这是 Win98 的问题:环境变量不购用了。
您得调整一下 autoexec.bat 以及 startserver.bat 中的环境变量,
去掉一些没有用的。用Win NT就不会有这个问题。
请看 jwdsk-1.0.1/readme.html,其中有解决方法。
 
C

cAkk

Unregistered / Unconfirmed
GUEST, unregistred user!
孙博: 刚才CJ打听您老情人节咋过的呢! 他今天晚上有约会. :p
 
S

snows

Unregistered / Unconfirmed
GUEST, unregistred user!
我在NT下用,键入http://localhost:8080,能看到 JSWDK 的欢迎页,但浏览jsp网页时
提示:
HTTP 500 - Internal server error
在执行 startserver.bat后 提示如下:
Quite often this warning is a result of not including the
necessary packages in the CLASSPATH environment which was
used to invoke com.sun.web.shell.Startup. This can be corrected
by adding the following to your CLASSPATH environment variable
and restarting JSWDK:
for jdk 1.2.x on unix:
% CLASSPATH=[jdkHome]/lib/tools.jar:$CLASSPATH;
export CLASSPATH
for jdk 2.1.x on windows:
% CLASSPATH=[jdkHome]/lib/tools.jar:%CLASSPATH%
......
where [jdkHome] represents the location of your jdk
installation directory
endpoint created:localhost/127.0.0.1:8080
请问如何解决?
to yysun:
我的JSWDK目录中没有readme.htm这个文件,只有readme.txt和FAQ两个帮助文件!
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
snows: 您需要安装 JDK1.2,然后设置环境变量:
CLASSPATH=<您安装JDK的路径>/lib/tools.jar;%CLASSPATH%
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
<h1>
JavaServer Pages (tm) Web Development Kit</h1>
<h1>
Frequently Asked Questions</h1>
Thisdo
cument lists some frequently asked questions about the JavaServer(TM)
Web Development Kit (JSWDK). Separatedo
cuments are available on the component
technologies (Servlets and JSP) at java.sun.com:
<ul>
<li>
<b><a href="http://java.sun.com/products/jsp/faq.html">JSP FAQ</a></b></li>
<li>
<b><a href="http://java.sun.com/products/servlet">Information on Servlets</a></b></li>
</ul>
<b>What environment variablesdo
I need to set to use the JSWDK?</b>
<p>You need a correct version of the JDK in the CLASSPATH variable. (For
Unix, JDK 1.1.x or 1.2. For Windows, JDK 1.2.)
<p>If you are using JDK 1.2, you also need todo
<i>one</i> of the following:
<ul>
<li>
Set JAVA_HOME to the JDK directory.</li>
<li>
Put tools.jar in the CLASSPATH variable.</li>
</ul>
All other necessary classes and jar files are managed by the startserver
script or batch file.
<p><b>Where are the classes for JSPs and Servlets?</b>
<br>&amp;nbsp;The files are as follows:
<ul>
<li>
webserver.jar -- class files for the Servlet Engine</li>
<li>
lib/jspengine.jar -- class files for the JSP Engine</li>
<li>
lib/servlet.jar -- public APIs for Servlets</li>
<li>
lib/xml.jar -- classes for parsing XMLdo
cuments</li>
</ul>
<b>Can I combine these classes with other webservers?</b>
<p>The JSP engine uses only the public portion of the Java Servlet 2.1
API. In theory, it could run on other Servlet engines that support the
Servlet 2.1 API. Sun has not tested this release on any Servlet engine
other than the one in the JSWDK.
<p><b>Wheredo
I put my JSP sources and beans?</b>
<p>If you are testing JSP pages without creating a separate web application,
you can use the default "Example" application. If you are creating a new
web application, refer to the question on installing a new web application
in this FAQ.
<p>To use the default "Example" application:
<ol>
<li>
Put all of your JSP source files in /examples/jsp, either directly or in
their own subdirectory.</li>
<li>
Put all of your Beans (class files) under /examples/WEB-INF/jsp/beans.
The startserver script automatically adds these classes to CLASSPATH at
runtime.</li>
<li>
If your server is already running, stop and restart it.</li>
<li>
Invoke your JSP pages using http://locahost:8080/examples/jsp/yours.jsp</li>
</ol>
<b>What is a web application?</b>
<p>A web application is a collection of resources that is mapped to a specific
Uniform Resource Identifier (URI) prefix. These resources may include JSP
pages, Servlets, HTML files, and images.
<p>For example, all of the resources related to baseball can be assembled
into a "baseball" directory. All requests starting with "/baseball" could
then
be mapped to this application.
<p><b>Howdo
I install a new web application?</b>
<ol>
<li>
Create a directory for the web application. In the following examples,
we will call this WEBAPP. The directory could have the same structure as
the Examples directory, with subdirectories for jsp, servlets, WEB-INF,
and images, if appropriate. One way todo
this is to copy the Examples
directory and then
edit the files as necessary.</li>
<li>
Add a new application to the JSWDK by editing the file webserver.xml in
the root JSWDK directory.</li>
<p><br>For example, to create a baseball application, you would make the
following additions to the file (at the appropriate location):
<pre>&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;WebApplication id="baseball0" mapping="/baseball"do
cBase="baseball="/></pre>
Read the webserver.xml file for more details on the syntax and options.
See the questions below for installing Servlets, JSP pages and Beans.</ol>
<b>Howdo
I install Servlets within my web application?</b>
<p>Use the following procedure, substituting your application directory
for WEBAPP:
<ol>
<li>
Compile the Servlet and determine which web application context you will
add it to.</li>
<li>
Add the Servlet class file to the WEBAPP/WEB-INF/servlets directory.</li>
<li>
Activate the newly installed Servlet by registering (adding) the servlet
in the WEBAPP/WEB_INF/servlets.properties file. See the Examples/WEB-INF/servlets
file for an example.</li>
<li>
Optionally, you can map the Servlet to URI requests relative to the context
in which the Servlet is located by adding an entry in the WEBAPP/WEB-INF/mappings.properties
file. See the Examples/WEB-INF/mappings.properties file for an example.</li>
<li>
Restart the server.</li>
</ol>
Access the Servlet using the following method, where WEBAPP is the web
application URI name, and SERVLET_NAME is the base name of the servlet:
<br>&amp;nbsp;
<br>&amp;nbsp;
<pre>&amp;nbsp;&amp;nbsp;&amp;nbsp;
http://localhost:8080/WEBAPP/servlet/SERVLET-NAME</pre>
If you have associated a URI path mapping to your servlet, you can access
it as follows, where EXTENSION is a file time extension and MAP-PATH is
an associated URI MAP path:
<pre>&amp;nbsp;&amp;nbsp;&amp;nbsp;
http://localhost:8080/WEBAPP/foo.EXTENSION
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
--- or ---&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;
http://localhost:8080/WEBAPP/MAP-PATH</pre>
<b>Howdo
I install JSP pages and Java Beans in a web application?</b>
<ol>
<li>
Put the JSP source files in any directory under your application directory
(/WEBAPP in the examples above).</li>
<li>
Make sure that the compiled beans are in the CLASSPATH. This can bedo
ne
either by setting the CLASSPATH manually or by editing the startserver
script.</li>
<li>
Edit the file WEBAPP/WEB-INF/mappings.properties and the file WEBAPP/WEB-INF/servlets.properties
to map ".jsp" in the URI to the JSP Servlet which will process the jsp
file. (See the property files in /examples/WEB-INF/ for an example. Your
mapping should be similar.)</li>
<li>
Finally, restart the server.</li>
</ol>
You can invoke your new JSP page using a URI similar to the following:
<pre>&amp;nbsp;&amp;nbsp;&amp;nbsp;
http://localhost:8080/WEBAPP/yourfile.jsp</pre>
<b>How are the URIs mapped at the server?</b>
<p>The web-server matches the begin
ning of the requested URI with the prefixes
of all contexts (web-applications). If no context matches, it uses the
default context instead.
<p><b>Howdo
you pass data from a Servlet to a JSP page?</b>
<p>See the JSP examples included with the JSWDK for samples of passing
data from a Servlet to a JSP page, and from a JSP page to a Servlet.
<p><b>Whatdo
the different init parameters mean?</b>
<dl>
<dt>
keepgenerated:</dt>
<dd>
Indicates whether or not to keep the generated Java file. The options are
true or false. Setting this to true retains the generated files. Setting
it to false deletes these files after compilation.</dd>
<dt>
scratchDir:</dt>
<dd>
This sets the location for the work directory, which will be created for
storing all generated code. This can be set to any directory. The work
directory will be created under thedo
cBase.</dd>
<dt>
largeFile:</dt>
<dd>
True or false. Set this to true for large files. When this value is true,
all static HTML is stored in a separate data file.</dd>
<dt>
sendErrToClient:</dt>
<dd>
True or false. If this parameter is set to true, all compilation/parsing
errors will be sent as part of the response to the client.</dd>
<dt>
ieClassId:</dt>
<dd>
This parameter is used to activate the IE plug-in. The default value is
set for IE 4 and 5. If the classID for IE changes in the future, this parameter
will be helpful.</dd>
</dl>
<b>Whatdo
es a 404 error mean?</b>
<p>It means the server was not able to locate the resource you requested.
This may be due to one of two reasons:
<ul>
<li>
The URL you entered was wrong or had a typo.</li>
<li>
The URL could not be resolved with the current "docBase." If you are running
your own web applications, please read the questions related to installing
your own web application.</li>
</ul>
<b>Whatdo
es a 505 error mean?</b>
<p>A 505 error represents an "internal server error" encountered while
processing your request. To find out more about the error, study the trace
at the server window.
<p>These errors can occur when translating JSP source to a Servlet. Translation-time
errors typically occur because of a syntax error in the JSP file or in
the generated Java file. Use the error message at the server window for
debugging.
<p>Errors can also occur at request time. Again, refer to the server-side
trace for information about the specific problem or exception.
 
S

snows

Unregistered / Unconfirmed
GUEST, unregistred user!
to yysun:
我已经安装了JDK1.2.2,并在AUTOEXEC.BAT中设置了环境变量:
CLASSPATH=C:/jdk1.2.2/lib/tools.jar;%CLASSPATH%
但还是不行;不过我发现在startserver.bat文件中用到的./lib/jakarta.jar ;
./lib/jsp.jar ;
./lib/moo.jar 这三个文件在我的硬盘上根本没有,是不是下载时丢了?
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
snows: jakarta.jar jsp.jar moo.jar 没有也没关系,我也没有
您可以在NT的DOS窗口下,用set CLASSPATH看看
这个环境变量设得对吗?
>但浏览jsp网页时提示: HTTP 500 - Internal server error
浏览什么 jsp 网页? 是jswdk本身的例子还是你自己的jsp网页?
 
S

snows

Unregistered / Unconfirmed
GUEST, unregistred user!
是jswdk本身的例子
 
S

snows

Unregistered / Unconfirmed
GUEST, unregistred user!
to yysun:
我终于发现问题在哪儿了!
我每次是通过在NT的资源管理器中点击startsever.bat文件来启动服务器,
每次都会有原来错误提示;但如果我在MS-DOS窗口下键入startsever启动服务器,
运行正常。
谢谢孙博士不厌其烦的给我指导!
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
调试 JSP 时,经常需要关闭和重新打开 JSWDK / Tomcat.
为此,我用Delphi编了个 JSP Launcher,包括两个工具:
1) 在Tray里放一个图标,能控制 JSWDK / Tomcat 的打开和关闭。
2) 一个NT Servie,能在机器启动时自动开启 JSWDK / Tomcat。
JSP Launcher 可以在大富翁练功场下载 http://lgc.delphibbs.com
带源码和编译好的可执行程序。
发现bug请通知我.
 
O

once

Unregistered / Unconfirmed
GUEST, unregistred user!
to yysun:
我的运行环境是WIN98,我全部按照您的要求进行设置,怎么还是不行?
out of enviroment space!
 
Y

yysun

Unregistered / Unconfirmed
GUEST, unregistred user!
用 cAkk 的方法很好啊,
>>打开一个dos prompt窗口,选菜单"属性|内存|初始化环境",设置为"2186",
>>然后关闭,重新打开一个dos窗口运行
startserver.bat / startup.bat
 
H

hotpin

Unregistered / Unconfirmed
GUEST, unregistred user!
Snows,能否将JWSDK放入某一FTP,如北邮。谢谢
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
908
import
I
I
回复
0
查看
607
import
I
顶部