jsp现在也没人用了吧,只不过也算是学习路途中的一个吧,记录一下
第一种:web.xml配置文件中加入
<welcome-file-list>
<!--指定tomcat启动进入的首页-->
<welcome-file>index.jsp</welcome-file>
<!--若index.jsp未找到,则执行下一个访问页面-->
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
第二种:index.jsp用重定向方式跳转页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
<!--指定要重定向跳转的页面-->
response.sendRedirect("user/index");
%>
第三种:dispatcher-servlet.xml添加如下的代码
<!--指定tomcat启动进入的首页-->
<mcv:view-controller path="/" view-name="forward:/user/index"></mcv:view-controller>