Why does the servlet send a null value to the JSP page instead of a text string? Here is the servlet and the doGet () method :
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("myresult", "Proba"); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/mypage.jsp"); dispatcher.forward(request, response); } Here is a snippet from mypage.jsp:
<form ACTION = "/servlet/ShowParameters" method = "post" id = "formId"> <div> <table id = "myTable" width="100%"> <tr> <td><%= request.getAttribute("myresult") %></td> </tr> </table> </div> </form> Expected value of Proba , and I receive null ?
Tried to make an empty page mypage.jsp . Make sure - this is the one that is displayed. She's the only one with me.
mypage.jspgo directly tomypage.jspor through a servlet? - Roman