I have a servlet that sends values to a JSP page. On my JSP I use EL ${} to display values. All works ok. But I need to assign some values to variables
heer is my simplified code
servlet
CODE
req.setAttribute("Message" , Message);
req.setAttribute("arrayApp" , arrayApp);
req.setAttribute("insertId" , insertId );
RequestDispatcher dispatcher = req.getRequestDispatcher("Process.jsp");
dispatcher.forward(req,res);
JSP
CODE
<table>
<tr><td>${arrayApp[0]}</td></tr>
<tr><td>
<%= request.getAttribute(insertId) %>
</td></tr>
</table>
I am just trying to use insertId but after trying so many different ways not successful. Not only insertId (object from database) but I can't seem to receive any values other than by using EL.
The question is what is the object I need to use to receive values?
Regarding the insertId I used toString() to convert it to String before sending it. But result is the same.
Many Thanks