Last active
December 17, 2015 05:49
-
-
Save thaniaclair/5561207 to your computer and use it in GitHub Desktop.
Interceptor que verifica se o {@link Usuario} fez a autenticação com senha.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static br.com.sebrae.action.BaseAction.NO_PASSWORD; | |
| import javax.servlet.http.HttpServletRequest; | |
| import org.apache.struts2.ServletActionContext; | |
| import br.com.sebrae.action.BaseAction; | |
| import br.com.sebrae.model.Usuario; | |
| import br.com.sebrae.util.ActionRetriever; | |
| import br.com.sebrae.util.SessionKeys; | |
| import com.opensymphony.xwork2.ActionInvocation; | |
| /** | |
| * Interceptor que verifica se o {@link Usuario} fez a autenticação com senha. | |
| * @author thania | |
| * @since 2013-04-08 | |
| */ | |
| public class CompleteLoginInterceptor extends BaseInterceptor { | |
| private static final long serialVersionUID = 4745824425259102232L; | |
| /** | |
| * {@inheritDoc} | |
| */ | |
| @Override | |
| public String intercept(ActionInvocation act) throws Exception { | |
| BaseAction action = (BaseAction) act.getAction(); | |
| if (action.isCompleteLogged()) return act.invoke(); | |
| HttpServletRequest request = ServletActionContext.getRequest(); | |
| String currentURL = new ActionRetriever(request).getCurrentURL(); | |
| action.getSession().put(SessionKeys.PREVIOUS_URL.name(), currentURL); | |
| return NO_PASSWORD; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment