eclipse部署项目

第一:部署项目:写完之后,去servers里右键添加项目(从左面放到右面),其中path就是链接地址的第一个单词(跟目录)。例如:select menu_url  from tp_menu  where menu_name='一般申请录入'的地址是ftyszx/czglxt/bgtReq/bgtReqInsert/bgtReqInsert.jsp,因此预算执行项目的path就是‘/ftyszx’

     <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">

<Context docBase="ftyth_base" path="/ftbase" reloadable="false" source="org.eclipse.jst.jee.server:ftyth_base">
           <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" initialSize="5" maxActive="10" maxIdle="10" maxWait="10000" minIdle="3" name="wf" password="1" type="javax.sql.DataSource" url="jdbc:oracle:thin:@172.17.103.7:1522:orcl11 " username="ftyth0119"/>  
  </Context>

 </Host>

第二:这种写法,docBase后面跟着的是路径,不用在右键add and remove后添加项目了

<Context docBase="D:\WorkSpace\ftythmain\webroot"
     path="/UIServer" reloadable="false">
     <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver"
      initialSize="5" maxActive="10" maxIdle="10" maxWait="10000"
      minIdle="3" name="wf" password="1" type="javax.sql.DataSource"
      url="jdbc:oracle:thin:@172.17.103.7:1522:orcl11" username="ftyth0105" />
    </Context>

第三种做法:把每个项目不配置在eclipse中的service里了,而是把每个项目都配置在tomcat的service.xml中。路径如下:D:\Tomcat 6.0\conf。首先在eclipse中的窗口--->首选项中找到tomcat6.0,然后选择单选按钮service.xml,然后就在d盘的tomcat下去配置就好了。具体配置如下

 <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->       

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
   <Context path="/ft" docBase="D:\workspace\java\fengtai\cloudplatform\webroot" debug="0"
             reloadable="false" >
     <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver"
      initialSize="5"
      maxActive="10"
      maxIdle="10"
      maxWait="10000"
      minIdle="3"
      name="wf"
      username="ft1"
      password="1"
      type="javax.sql.DataSource"
      url="jdbc:oracle:thin:@172.17.103.132:1521:orcl" />
    </Context>

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>

猜你喜欢

转载自1601844782.iteye.com/blog/2273941