Java學習01-使用maven外掛程式tomcat搭建web maven項目

來源:互聯網
上載者:User

標籤:連接埠   搭建   pid   art   tomcat   技術   pos   group   dea   

我使用社區版的IDEA,社區版的沒有tomcat外掛程式,只能使用maven外掛程式進行tomcat的使用了,下面進入正題

一、pom.xml配置tomcat外掛程式

<build>    <finalName>JavaDemo</finalName>    <plugins>      <plugin>        <groupId>org.apache.tomcat.maven</groupId>        <artifactId>tomcat7-maven-plugin</artifactId>        <version>2.2</version>        <configuration>          <path>/${build.finalName}</path>          <port>8080</port>        </configuration>      </plugin>    </plugins>  </build>

 

build.plugins標籤中是配置外掛程式的,中就配置了tomcat7的外掛程式,web項目將運行在這個外掛程式上;

啟動後的basepath如:

 

二、tomcat外掛程式configuration屬性說明

path  是訪問應用的路徑

port  是tomcat 的連接埠號碼

uriEncoding  是URL按UTF-8進行編碼,這樣就解決了中文參數亂碼。

Server  是指定tomcat名稱。

 

Java學習01-使用maven外掛程式tomcat搭建web maven項目

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.