src/java/Controllers/SettingsController.java
/**
     * Handles the HTTP <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Handles the HTTP GET method.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Handles the HTTP GET method . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        HttpSession session = request.getSession(false);
        User user = new User();
        UserDAO userDAO = new UserDAO();
        if(session.getAttribute("user_id") != null)
        {
            int userid = (Integer) session.getAttribute("user_id");
            user = userDAO.get(userid);
            request.setAttribute("user", user);
            RequestDispatcher rd = request.getRequestDispatcher("views/settings.jsp");  
            rd.forward(request, response);
        }
        else
        {
            RequestDispatcher rd = request.getRequestDispatcher("views/404.jsp");
            rd.forward(request, response);
        }
    }
@ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { HttpSession session = request . getSession ( false ) ; User user = new User ( ) ; UserDAO userDAO = new UserDAO ( ) ; if ( session . getAttribute ( "user_id" ) != null ) { int userid = ( Integer ) session . getAttribute ( "user_id" ) ; user = userDAO . get ( userid ) ; request . setAttribute ( "user" , user ) ; RequestDispatcher rd = request . getRequestDispatcher ( "views/settings.jsp" ) ; rd . forward ( request , response ) ; } else { RequestDispatcher rd = request . getRequestDispatcher ( "views/404.jsp" ) ; rd . forward ( request , response ) ; } }
Handles the HTTP <code>GET</code> method.
Handles the HTTP <code > GET< / code > method .