eclipse maven命令启动tomca遇到的问题,首页拦截问题

来源:互联网 发布:sql delete语句 编辑:程序博客网 时间:2024/06/11 13:35

用命令tomcat:run只会启动tomcat6

而用tomcat7:run启动会按插件启动tomcat7

插件配置这里是7

<build><plugins><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><configuration><path>/</path><port>8082</port></configuration></plugin></plugins></build>
而6的话是
<build><plugins> <plugin>    <groupId>org.codehaus.mojo</groupId>    <artifactId>tomcat-maven-plugin</artifactId>    <version>1.1</version>    <configuration>       <port>8081</port>       <uriEncoding>UTF-8</uriEncoding>       <path>/</path>    </configuration></plugin></plugins></build>
多了一个

    <groupId>org.codehaus.mojo</groupId>

用了tomcat7,可以启动首页拦截

操作,web。xml

<welcome-file-list><welcome-file>index.html</welcome-file></welcome-file-list>
controller

操作

@RequestMapping("/index")public String showIndex(){return "index";}
这里没有加后缀,两个名称一样