I have the following method in servlet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setAttribute("categories", categoryService.getAll());
RequestDispatcher dispatcher = request.getRequestDispatcher("/Category.jsp");
dispatcher.forward(request, response);
}
and when i call jsp page i want to get all categories from get but it's simply does not call get method
here is my jsp
<body>
<% List<CategoryDTO> categoryList=new ArrayList<CategoryDTO>();
categoryList=(ArrayList<CategoryDTO>)request.getAttribute("categories");
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:forEach items="${categoryList}" var="element">
<tr>
<td>${element.name}</td>
</tr>
</c:forEach
Can anyone help me please?