下载首页 | 资讯中心 | 下载分类 | 最近更新 | 排 行 榜 | 国产软件 | 国外软件 | 汉化补丁 |
文章搜索: 分类 关键字 收藏本站设为首页
您的位置:首页网页设计JSP(java)教程 → 如何快速建立Servlet和JSP的运行环境
如何快速建立Servlet和JSP的运行环境
日期:2007-6-3 10:03:28 人气:156     [ ]
上一页 [1] [2] [3] 下一页







The recommended way to do this is to download the file bluej_tomcat_config.zip(http://www.csu.edu.au/faculty/sciagr/sis/subjects/itc357/bluej_tomcat_config.zip) and extract the files to the root directory on drive c:, making sure that you choose the option to use folder names.







If you need to manually configure BlueJ or Tomcat, you need to troubleshoot problems or you want to examine the configuration options chosen, they are explained here.



Compiling and Running Servlets on Your Local Machine







1. Run BlueJ and open the existing project in the c:\Program Files\Apache Tomcat 4.0\webapps\testing\Web-inf\classes directory







2. Create a new class and enter the code for your servlet, or use Edit-Add class from file to import an existing servlet source file.







3. Compile the servlet.







4. Start tomcat by double-clicking on startup.bat in the c:\Program Files\Apache Tomcat 4.0\bin directory. This will start Tomcat listening on port 8080 on your local machine (you don't need to be online).







5. Start up your web browser and open the URL http://localhost:8080/testing/servlet/Servletname where Servletname is the name of your servlet.



File locations and relative references within local and remote servlets







HTML files located in a directory like c:\Program Files\Apache Tomcat 4.0\webapps\testing will be accessible through a URL like http://localhost:8080/testing/filename.html







Similarly if you place an HTML file in your home directory on the SWAP server it will be assessible through a URL like http://swap.csu.edu.au:8080/username/filename.html







If you need to place an image in a page generated by a servlet, you can place it in c:\Program Files\Apache Tomcat 4.0\webapps\testing (or on the swap server in your home directory) and refer to it in the HTML as http://www.knowsky.com/imagename.jpg (eg. <IMG SRC="http://www.knowsky.com/imagename.jpg">)







If you need to link to another servlet or specify another servlet within the ACTION attribute of a form, you can simply use the servlets name. For example you could use the code <A HREF="OtherServlet"> to link to another servlet assuming that you have a file in the testing\Web-inf\classes directory called OtherServlet.class (or in your Web-inf\classes directory on the SWAP server)







If you have a static HTML page that has a link to a servlet or a form with an ACTION attribute that refers to a servlet, and the HTML page is located in the c:\Program Files\Apache Tomcat 4.0\webapps\testing directory or in your home directory on the SWAP server, use the URL servlet/ServletName to refer to the servlet (eg. ACTION="servlet/ServletName").
出处:本站原创 作者:佚名
 阅读排行
01.精美qq空间横幅代码
02.最酷qq个性女生网名
03.最新又有免费QQ秀啦《..
04.巧用透明FlaSh扮靓你的..
05.花之神匠代码(最新代码..
06.最新QQ空间免费导航
07.最新免费个人形象设置..
08.最新qq空间flash代码m..
09.CSS技术结合图像实现动..
10.Photoshop光影魔术师:..
11.QQ音速种子狂刷
12.最新QQ空间透明代码
13.PS实例教程:教你制作结..
14.Photoshop光影魔术师:..
15.制作背景图__教程
16.用Photoshop制作漂亮的..
17.如何获得QQ音速种子
18.≤QQ空间代码≥在日志..
19.网页浮动广告的制作代..
20.用Photoshop制作大红灯..
21.常用CSS
22.Photoshop给靓丽美女打..
 推荐文章
·Photoshop 表现技法之..
·快速将你的相片矢量化..
·PHOTOSHOP制作炽热的太..
·用Photoshop制作美丽的..
·流行杀手的娃娃工厂__..
·打造8号台球__教程
·PHOTOSHOP制作待机MM图..
·用Photoshop帮MM做纹身..
·PHOTOSHOP美眉着色绝招..
·PHOTOSHOP花露的制作_..
·PHOTOSHOP渐变工具的巧..
·PHOTOSHOP手绘奥兰多-..
·高难度抠图两种方法__..
·Photoshop高尔夫球的制..
·Photoshop打造精美玉佩..
Eqxia_COM下载站 版权所有 Copyright© 2001-2005 Www.eqxia.COM, All Rights Reserved.