Given this doGet implementation:
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    if (request.getParameterMap().isEmpty()) {
        // DAO initialized in init() method
        Collection<User> users = resource.getUsers();
        if (users != null){
            HttpSession session = request.getSession();
            session.setAttribute("users", users);
        }
        request.getRequestDispatcher("/WEB-INF/users/index.jsp").forward(request, response);
    }
    else {
        String name = request.getParameter("name");
        // DAO initialized in init() method
        User user = resource.getUser(name);
        if (user == null){
            request.setAttribute("message", "Unknown user: " + name);
            request.getRequestDispatcher("/WEB-INF/errors/404.jsp").forward(request, response);
        }
        else {
            HttpSession session = request.getSession();
            session.setAttribute("user", user);
            request.getRequestDispatcher("/WEB-INF/users/show.jsp").forward(request, response);
        }
    }
}
Questions:
- Is request.getParameterMap().isEmpty()the preferred way to test for the presence of parameters?
- Is there a way to infer the views' location (/WEB-INF/users/) from the either the Servlet's context or an annotation?
 
     
    