search

Home  >  Q&A  >  body text

java - spring mvc Controller URL是否可以实现动态配置

使用spring mvc开发的应用后台登录地址,如何实现动态配置,以防止扫描登录url, 就像wordpress的后台登录地址一样可以在后台自行修改。 有什么思路,可以实现?

迷茫迷茫2824 days ago764

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 11:14:58

    There is a PathVariable thing in the latest spring3. Its main purpose is to extract the path variables contained in the RequestMapping url. Currently, it is mostly used to provide pseudo-static page urls. For example:

    @RequestMapping("/login/{loginId}.htm")
    public String login(@PathVariable("loginId")Long loginId, ModelMap model){
        ...    
    }
    

    The loginId in the above example is completely variable. You can dynamically configure the background login address by configuring this loginId in the background.

    reply
    0
  • Cancelreply