search

Home  >  Q&A  >  body text

java - 后台使用Spring MVC框架做web service,前台使用jQuery的情况下如何实现权限管理,会话控制?

难道是直接将session访问封装成接口(serverlet概念里面的.do?),前台每次页面访问或者ajax请求都先访问这个session的接口?

这个难道就是传说中的后台的前端?

只用过php,没接触过java web开发,有点昏,感觉这个思路可能是完全不正确的,望指点!

PHP中文网PHP中文网2890 days ago636

reply all(5)I'll reply

  • 黄舟

    黄舟2017-04-17 13:14:54

    Use cookies to save it. Most session implementations save the session ID in cookies.
    For each request, add a filter and process it. If the session ID is valid, it will be released. If it expires or there is no session ID, 404 will be returned

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:14:54

    Bring a sessionID every time you send a request?

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:14:54

    servlet filter

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:14:54

    I suggest you try Apache Shiro, this thing is very flexible.
    You can customize the verification method, authorization method, permission granularity, and authorization method according to your own needs. You can perform session management without the container, and it is very friendly to Spring.

    reply
    0
  • PHPz

    PHPz2017-04-17 13:14:54

    Regardless of language, permission management can be achieved by selecting proxy mode.

    reply
    0
  • Cancelreply