Web.xml映射

时间:2017-06-18 07:04:37

标签: servlets web-applications

我想在每个服务器启动时重定向到登录页面。请帮助我。

这是我的web.xml文件:

<?xml version="1.0" encoding="UTF-8"?>

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”     id =“WebApp_ID”version =“2.5”&gt;     MVCDemo              MVC-调度         org.springframework.web.servlet.DispatcherServlet         1                   MVC-调度         *     

<servlet>
    <description></description>
    <display-name>LoginController</display-name>
    <servlet-name>LoginController</servlet-name>
    <servlet-class>com.webblue.controller.login.LoginController</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>LoginController</servlet-name>
    <url-pattern>/LoginController</url-pattern>
</servlet-mapping>
<servlet>
    <description></description>
    <display-name>Register</display-name>
    <servlet-name>Register</servlet-name>
    <servlet-class>com.webblue.controller.login.LoginController</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Register</servlet-name>
    <url-pattern>/Register</url-pattern>
</servlet-mapping>
<servlet>
    <servlet-name>runJsp</servlet-name>
    <jsp-file>/pages/login.jsp</jsp-file>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>runJsp</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>
  pages/login.jsp
</welcome-file>
</welcome-file-list>

0 个答案:

没有答案