javaweb项目已经发布起来了,可是输入controller对应的地址,总是自己跳转到login?
天蓬老师
天蓬老师 2017-04-18 10:55:58
0
2
578

web.xml中没看出异常啊?

比如输入http://localhost:8080/dyn2/dy...
会自动调整到http://localhost:8080/dyn2/login

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 <description>Dynamic Matrix powered by Spring</description>
 <display-name>Dynamic Matrix</display-name>
 <context-param>
  <param-name>webAppRootKey</param-name>
  <param-value>dyn2.root</param-value>
 </context-param>
 <context-param>
  <param-name>log4jConfigLocation</param-name>
  <param-value>/WEB-INF/log4j.properties</param-value>
 </context-param>
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext.xml</param-value>
 </context-param>
 <filter>
  <filter-name>characterEncodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>utf8</param-value>
  </init-param>
 </filter>
 <!--<filter>
  <filter-name>ContentTypeFilter</filter-name>
  <filter-class>net.counters.dynm.web.ContentTypeFilter</filter-class>
  <init-param>
   <param-name>charset</param-name>
   <param-value>utf8</param-value>
  </init-param>
 </filter>
 -->
 <filter>
  <filter-name>springSecurityFilterChain</filter-name>
  <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
 </filter>
 <!-- <filter>
  <filter-name>UrlRewriteFilter</filter-name>
  <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
 </filter> -->
 <filter-mapping>
  <filter-name>characterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <!--<filter-mapping>
  <filter-name>ContentTypeFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 -->
 <filter-mapping>
  <filter-name>springSecurityFilterChain</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <!-- <filter-mapping>
  <filter-name>UrlRewriteFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping> -->
 <listener>
  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
 </listener>
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <listener>
     <listener-class>org.springframework.web.util.HttpSessionMutexListener</listener-class>
 </listener>
 <servlet>
  <servlet-name>dynMatrix</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <!-- <servlet-mapping>
  <servlet-name>dynMatrix</servlet-name>
  <url-pattern>/app/*</url-pattern>
 </servlet-mapping> -->
 <servlet-mapping>
  <servlet-name>dynMatrix</servlet-name>
  <url-pattern>/</url-pattern>
 </servlet-mapping>
 <session-config>
     <session-timeout>60</session-timeout>
 </session-config>
 <error-page>
  <error-code>403</error-code>
  <location>/errors/403.html</location>
 </error-page>
</web-app>

这是controller

    @RequestMapping(value="/create",method=RequestMethod.GET)
    public String getCreateForm(Model model){
        this.addEnableMap(model);
        model.addAttribute(new WebUser());
        //加载分类
        String cwhere = " where type_parent_id=0";
        List<CheckListType> checkListType = checkLMDao.getCheckListTypeByWhere(cwhere, 0, 0);
        
        model.addAttribute("checkListType", checkListType);
        return "createUserForm";
    }
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

répondre à tous(2)
Ty80

La demande de cette adresse peut nécessiter certaines informations de connexion pour la vérification. La demande en ajax transmettra ces informations
Si vous la saisissez directement dans le navigateur sans ces informations, elle sera interceptée et transmise par le filtre de sécurité. page de connexion.

刘奇


Peut-être que ce filtre a intercepté votre demande
Etes-vous seul responsable du projet ? Si ce n’est pas une question comme celle-ci, il est préférable de la poser à des collègues de la même équipe projet

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!