CSDN博客

img JAVAvNET

040917 R Tomcat&Eclipse Develop

发表于2004/9/17 14:44:00  682人阅读

a.使用Tomcat4.1.3开发JSP时,目录的结构。

1.使用Eclipse建立工程TestJspWebModule名称为Test

E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp

2.使用Eclipse新建Class : DBMSamplepackage: NEC2KJSYS.DBManager

   OraDataBasepackage: NEC2KJSYS.COM……

3.在Test下建立Web目录,将.jsp文件放到Web

4Eclipse自动生成的class文件位于

E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp/bin下面,

根据package生成相应的目录。

5.将class文件CopyWebModule目录Test下的/WEB-INF/classes(如图),jsp文件

   将使用该目录的class

6.在TestJsp/j2src下建立org/apache/jsp三级目录(Tomcat生成的jsp对应文件放于此)

7Tomcatserver.xml的设定:

    <Context path="/ECJSP"

docBase="E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp/Test"

debug="0" reloadable="true" crossContext="true"

workDir="E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp/j2src/org/apache/jsp">

    </Context>

8.运行。

   http://localhost/ECJSP/Web/Sample.jsp

 

b.Tomcat Config

       1.Add a new Virtual dir

        <Context path="/ECJSP" docBase="E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp/Test" debug="0"
                 reloadable="true" crossContext="true"
                 workDir="E:/DevSoft/eclipse-SDK-2.1.3-win32/eclipse/workspace/TestJsp/j2src/org/apache/jsp">
        </Context>

       2.port config

    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="80" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />

0 0

相关博文

我的热门文章

img
取 消
img