javaweb项目已经发布起来了,可是输入controller对应的地址,总是自己跳转到login?

 捕鱼达人2602881157 发布于 2022-10-25 17:42

web.xml中没看出异常啊?

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


http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 Dynamic Matrix powered by Spring
 Dynamic Matrix
 
  webAppRootKey
  dyn2.root
 
 
  log4jConfigLocation
  /WEB-INF/log4j.properties
 
 
  contextConfigLocation
  /WEB-INF/applicationContext.xml
 
 
  characterEncodingFilter
  org.springframework.web.filter.CharacterEncodingFilter
  
   encoding
   utf8
  
 
 
 
  springSecurityFilterChain
  org.springframework.web.filter.DelegatingFilterProxy
 
 
 
  characterEncodingFilter
  /*
 
 
 
  springSecurityFilterChain
  /*
 
 
 
  org.springframework.web.util.Log4jConfigListener
 
 
  org.springframework.web.context.ContextLoaderListener
 
 
     org.springframework.web.util.HttpSessionMutexListener
 
 
  dynMatrix
  org.springframework.web.servlet.DispatcherServlet
  1
 
 
 
  dynMatrix
  /
 
 
     60
 
 
  403
  /errors/403.html
 

这是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 = checkLMDao.getCheckListTypeByWhere(cwhere, 0, 0);
        
        model.addAttribute("checkListType", checkListType);
        return "createUserForm";
    }
2 个回答

  • 可能是这个过滤器拦截到了你的请求
    项目是你一个人在负责吗?如果不是这种问题最好问同一个项目组的同事

    2022-10-26 23:31 回答
  • 请求这条地址可能需要一些登录信息什么的做验证,在ajax里请求会把这些信息传过去,
    你直接浏览器输入不带有这些信息就会被security过滤器给拦截转发到登录页面了。

    2022-10-26 23:32 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有