tomcaot 7 的直接输入IP 就进到登陆页面去

1 .要实现省略8080端口,也不输入项目名,输入ip直接访问项目,需要实现在

上层的apache tomcat服务器的配置中,做出指定。
第一步在apache-tomcat-7.0.xx\conf(找到你特定版本的tomcat),找到目录下的server.xml文件,
找到:<Host name="localhost"  appBase="webapps"  unpackWARs="true" autoDeploy="true">
在其下面换行添加以下语句,将localhost或是ip,重定向到你的目录。
<Context path="" docBase="项目名" debug="0" reloadable="true"/>
重启tomcat,这样可以不输入项目了,还有人说了8080,我也不想输入了。
或者要发布,改到默认的80端口怎么办,很简单,还是在server.xml文件,将你的端口号改为80即可,重启tomcat,就可以直接输入ip访问自己的项目了
 
2.找到web.xml文件 添加项目登陆的路径 进入项目就进入到 这个地址去

<welcome-file-list>
<welcome-file>index/login.do</welcome-file>
</welcome-file-list>

posted @ 2016-10-17 20:12  伍春晖  阅读(345)  评论(0编辑  收藏  举报