src/java/br/org/catolicasc/fcgf/projprog4/web/controllers/AuthenticationControllerServlet.java
/**
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Processes requests for both HTTP GET and POST
methods.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Processes requests for both HTTP GET and POST methods . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        User user;
        String email = request.getParameter("email"); 
        String password = request.getParameter("password");
        if (email != null && password != null) {
            user = this.findUser(email, password);
            if (user != null) {
                HttpSession session = request.getSession(true);
                session.setAttribute("userid", Long.toString(user.getId()));
                session.setAttribute("username", user.getNome());
                session.setAttribute("userroleid", Long.toString(user.getRule().getId()));
                request.getRequestDispatcher("mvc?cmd=BuildMainMenuCmd").forward(request, response);
            } else {
                request.setAttribute("msg", "Credenciais inválidos ou usuario bloqueado!");
                request.getRequestDispatcher("signin.jsp").forward(request, response);
            }
        } else {
            request.setAttribute("msg", "Inserir credenciais!");
            request.getRequestDispatcher("signin.jsp").forward(request, response);
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { request . setCharacterEncoding ( "UTF-8" ) ; response . setCharacterEncoding ( "UTF-8" ) ; User user ; String email = request . getParameter ( "email" ) ; String password = request . getParameter ( "password" ) ; if ( email != null && password != null ) { user = this . findUser ( email , password ) ; if ( user != null ) { HttpSession session = request . getSession ( true ) ; session . setAttribute ( "userid" , Long . toString ( user . getId ( ) ) ) ; session . setAttribute ( "username" , user . getNome ( ) ) ; session . setAttribute ( "userroleid" , Long . toString ( user . getRule ( ) . getId ( ) ) ) ; request . getRequestDispatcher ( "mvc?cmd=BuildMainMenuCmd" ) . forward ( request , response ) ; } else { request . setAttribute ( "msg" , "Credenciais inválidos ou usuario bloqueado!") ; request . getRequestDispatcher ( "signin.jsp" ) . forward ( request , response ) ; } } else { request . setAttribute ( "msg" , "Inserir credenciais!" ) ; request . getRequestDispatcher ( "signin.jsp" ) . forward ( request , response ) ; } }
Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .
//name
 //session.setAttribute("usercompanyid", Long.toString(user.));
 //logservice
 //logservice
 //logservice
