0

grails 2.3.4spring security core 2.0 RC2spring security ui 1.0 RC1을 사용 중입니다. 모든 일이 잘 작동하지만 때마다 세션 시간 제한이있을 때마다 "Error in grail layout main "세션 레이아웃의 main.gsp 파일에서 세션 변수를 호출했기 때문에"이제 모든 세션 시간 초과 후 로그인 페이지로 리디렉션하고 오류를 표시하지 않으려 고합니다. 세션 시간 후 재 page.To 밖으로 난세션 시간 초과 후 로그인 페이지로 리디렉션 grails

def structureMap1 = Requestmap.findByUrl("/institution/index") ?: new Requestmap(url: "/institution/index",configAttribute: "ROLE_INSTITUTION").save(failOnError:true) 

bootstrap.groovy 파일에 일을했지만이 모든 페이지에 대한 쓰기 어렵다 있도록 많은 페이지가있다. 그것을 도와주세요 할 수있는 다른 방법이 있습니까.

답변

0

SecurityFilters를 사용하는 방법은 conf 폴더에 넣을 수 있습니다.

class SecurityFilters { 
    def filters = { 
     catchRememberMeCookie(url: "/**") { 
      before = { 

       if (!session.user) { 
        def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib() 
        def confirmurl= g.createLink(controller: controllerName, action: actionName, params:params, absolute: 'true') 
        session.lastURL=request.getHeader('referer') ?: confirmurl 

        redirect(controller:'auth',action:'denied') 
        return false 
       } 
    } 
} 

이 세그먼트는 상세한 답변을 제공하기에는 정보가 충분하지 않지만 보안 필터가있어 사용자의 질문에 답하지 않을 것입니다. 이는 모든 요청 위에 있으며 사용자가 요청할 경우 위의 다른 위치로 특정 값 등 다음에 session.user가없는 경우 다른 작업을 수행하여 모든 작업을 수행 할 수 있습니다.