Subversion Repositories bacoAlunos

Rev

Rev 2049 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.es.exemplos.hibernate.web.login;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import pt.estgp.es.exemplos.hibernate.services.ServicoSessoes;
import pt.estgp.es.exemplos.hibernate.web.SecurityFilter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class LoginAction extends DispatchAction
{
    public ActionForward login(ActionMapping mapping,
                              ActionForm form ,
                              HttpServletRequest request,
                              HttpServletResponse response)
            throws 1.5.0/docs/api/java/io/IOException.html">IOException, ServletException
    {

        LoginForm lf = (LoginForm) form;



        1.5.0/docs/api/java/lang/System.html">System.out.println(lf.getUsername());
        1.5.0/docs/api/java/lang/System.html">System.out.println(lf.getPassword());


        return mapping.getInputForward();

        //return mapping.findForward("ok");

    }
    public ActionForward logout(ActionMapping mapping,
                               ActionForm form ,
                               HttpServletRequest request,
                               HttpServletResponse response)
            throws 1.5.0/docs/api/java/io/IOException.html">IOException, ServletException
    {

        LoginForm lf = (LoginForm) form;


        new ServicoSessoes().logout();
        SecurityFilter.loadSessionProxy(true,request);

        return mapping.getInputForward();

        //return mapping.findForward("ok");

    }

}