Use variable into ${ } value expression

Viewed 48

I'm trying to get data from a method in class call readClientByIdProfessional(), these methods need an 'id' to works, I pass the 'id' from a JSP page to servlets and then when I pass the 'id' doesn´t work and not bring me the data. Here I declare the variable who get me the 'id':

Object idPro = null;
idPro = request.getAttribute("respuesta");

And here Im trying to pass the 'id' to ${ } value expression:

 <c:forEach var="dato" items="${UserDAO.readClientByIdProfessional(idPro)}"> 

Is the format I am using ok?

1 Answers

Request attributes are directly available as JSP EL variables, so just use respuesta directly:

<c:forEach var="dato" items="${UserDAO.readClientByIdProfessional(respuesta)}"> 
Related