formRemote não realiza update no render
28/09/2012 19:54
<g:formRemote url="[controller:'j_spring_security_check', action:'']"
class="dropdown-menu pull-right" name="loginForm" update="header">
<div id="header">
<g:render template="/templatesPadrao/header" model="['searchbarAtivo':true]"/>
</div>
def authfail = {
def username = session[UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY]
String msg = ''
def exception = session[WebAttributes.AUTHENTICATION_EXCEPTION]
if (exception) {
if (exception instanceof AccountExpiredException) {
msg = g.message(code: "springSecurity.errors.login.expired")
}
else if (exception instanceof CredentialsExpiredException) {
msg = g.message(code: "springSecurity.errors.login.passwordExpired")
}
else if (exception instanceof DisabledException) {
msg = g.message(code: "springSecurity.errors.login.disabled")
}
else if (exception instanceof LockedException) {
msg = g.message(code: "springSecurity.errors.login.locked")
}
else {
msg = g.message(code: "springSecurity.errors.login.fail")
}
}
if (springSecurityService.isAjax(request)) {
redirect action: 'auth', params: params
return
}
else {
flash.message = msg
redirect action: 'auth', params: params
}
}
def auth = {
def config = SpringSecurityUtils.securityConfig
if (springSecurityService.isLoggedIn()) {
redirect uri: config.successHandler.defaultTargetUrl
return
}
String view = 'auth'
String postUrl = "${request.contextPath}${config.apf.filterProcessesUrl}"
render view: view, model: [postUrl: postUrl,
rememberMeParameter: config.rememberMe.parameter]
}
<html>
<body>
<g:formRemote url="[controller:'j_spring_security_check', action:'']"
class="dropdown-menu pull-right" name="loginForm" update="header">
</g:formRemote>
<div id="header"></div>
</body>
</html>
Para se registrar, clique aqui.