最近学习spring,在网上找了一个简单登陆的DEMO,弄好后文件路径是这样的
WEB.XML里的内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>SpringDemo</display-name>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>SpringDemo.webapp.root</param-value>
</context-param>
<!-- 指定log4j配置文件的位置 -->
<!-- WebApplicationContext需要使用日志功能,放在Spring配置的前面 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>
<!-- -->
<context-param>
<param-name>log4fRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<!-- 指定Spring配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- 定义Web容器监听器,监听器负责完成IoC容器在Web环境中的启动工作 -->
<!-- IoC容器启动过程就是建立上下文的过程 -->
<!-- ContextLoaderListener启动的上下文为根上下文 -->
<!-- ContextLoaderListener实现了ServletContextListener接口 -->
<!-- ContextLoaderListener->ContextLoader:1,载入IoC容器到Web容器;2,实例化WebApplicationContext -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置log4j的监听器 -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- DispatcherServlet起着分发请求的作用,Spring MVC的核心 -->
<!-- ContextLoaderListener初始化完成后,Web容器开始初始化DispatcherServlet -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcherServlet.xml</param-value>
</init-param>
</servlet>
<!-- 指定需要处理的http请求 -->
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/WEB-INF/views/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
现在网页输入localhost:8080/bysj 能到index.jsp,我要怎么样才能让他直接到login.jsp呢?应该在哪里配置?还有可以直接localhost:8080就进入首页吗?
刚刚学习所以不太懂,好心人帮帮忙啊~~~~~急急急~~~~