小编use*_*836的帖子

如何在Spring Security中从会话管理(超时/并发检查)中排除某些页面?

我添加了此代码spring-security.xml以启用会话超时检查和并发检查.

<sec:http>
    <sec:form-login login-page="/login" login-processing-url="/authentication"
                    default-target-url="/home" always-use-default-target="true"
                    authentication-failure-url="/login?error=true"
                    username-parameter="userid" password-parameter="password"/>
    <sec:logout logout-url="/logout" logout-success-url="/login" delete-cookies="JSESSIONID" invalidate-session="true" />

    <!-- User login (URL not View Name) -->
    <sec:intercept-url pattern="/login" access="permitAll" />

    <!-- User change password -->
    <sec:intercept-url pattern="/change_password" access="permitAll" />


    <sec:session-management invalid-session-url="/session_timeout">
        <sec:concurrency-control max-sessions="1" error-if-maximum-exceeded="false" expired-url="/session_conflict"/>
    </sec:session-management>

    <sec:headers>
        <sec:frame-options policy="SAMEORIGIN" />
    </sec:headers>
</sec:http>
Run Code Online (Sandbox Code Playgroud)

但问题是,

  1. 我需要login change_password从会话检查(超时和并发)中排除一些页面.

  2. 如果我有一个可供登录用户或未登录用户访问的页面.但是我只需要在用户登录时进行会话超时和并发检查.

我该如何实现呢?

非常感谢.

java spring spring-mvc spring-security spring-boot

7
推荐指数
1
解决办法
2008
查看次数

如何暂时禁用反应,只需更新/检索本地mongodb?

考虑到这个要求.

在发布新帖子之前,在编辑时,会有一个预览面板,可在您键入时呈现您的帖子内容.

因为它不是真正的帖子,我们只希望它只会更新(并从中检索内容)本地mongodb并且不希望这个帖子会同步到服务器.如何实现?

我在模板中试过这个

Template.newPost.events
  'keyup .post-content' : (event, templ)->
    event.preventDefault()
    Deps.nonreactive ->
      Post.update({_id: post_id}, {content: event.currentTarget.value })
Run Code Online (Sandbox Code Playgroud)

还有这个

Template.newPost.events
  'keyup .post-content' : (event, templ)->
    event.preventDefault()
    Meteor.call 'updatePostContent', post_id, event.currentTarget.value


Meteor.methods
  updatePostContent: (postId, value)->
    if (this.isSimulation)
      Post.update({_id: postId}, {content: value })
    else
      this.stop()
Run Code Online (Sandbox Code Playgroud)

以上所有都没有效果.

抱歉我的英语不好.

mongodb meteor

1
推荐指数
1
解决办法
2324
查看次数