亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

javaweb項目已經發布起來了,可是輸入controller對應的地址,總是自己跳轉到login?

javaweb項目已經發布起來了,可是輸入controller對應的地址,總是自己跳轉到login?

茅侃侃 2019-03-01 11:10:44
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"; }
查看完整描述

1 回答

?
交互式愛情

TA貢獻1712條經驗 獲得超3個贊

請求這條地址可能需要一些登錄信息什么的做驗證,在ajax里請求會把這些信息傳過去,
你直接瀏覽器輸入不帶有這些信息就會被security過濾器給攔截轉發到登錄頁面了。

查看完整回答
反對 回復 2019-03-01
  • 1 回答
  • 0 關注
  • 797 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號