src/main/java/codeu/controller/FollowingServlet.java
/**
     * This function fires when a user navigates to the following page. It gets all of the
     * users that this user follows from the model and forwards to following.jsp for
     * rendering the list.
     */
This function fires when a user navigates to the following page. It gets all of the
users that this user follows from the model and forwards to following.jsp for
rendering the list.
This function fires when a user navigates to the following page . It gets all of the users that this user follows from the model and forwards to following . jsp for rendering the list .
@Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        String username = (String) request.getSession().getAttribute("user");
        List<String> following = new ArrayList<>();
        if(username!=null && !username.isEmpty())
            following = userStore.getFollowing(username);
        request.setAttribute("following", following);
        request.getRequestDispatcher("/WEB-INF/view/following.jsp").forward(request, response);
    }
@ Override public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String username = ( String ) request . getSession ( ) . getAttribute ( "user" ) ; List < String > following = new ArrayList < > ( ) ; if ( username != null && ! username . isEmpty ( ) ) following = userStore . getFollowing ( username ) ; request . setAttribute ( "following" , following ) ; request . getRequestDispatcher ( "/WEB-INF/view/following.jsp" ) . forward ( request , response ) ; }
This function fires when a user navigates to the following page.
This function fires when a user navigates to the following page .