I am looking for some suggestions and tips regarding Servlet/JSP issue I am trying to solve. I need to access a Servlet variable in JSP page which I am passing through the request.setAttribute, then the variable needs to be passed onto another Servlet through doPost. I am able pass that to the page and can display/print, but I would like it to be not displayed, but just passed on to the Submit button.
Here’s my Servlet code:
request.setAttribute("jsession", jsession);
I can do the following and it works, but it’s displaying it on the page and the end-user doesn’t need to see this:
<select name="jsession">
<c:forEach var="jsession" items="${jsession}">
<option value="${jsession}">${jsession}</option>
</c:forEach>
</select>
But, I am looking to do something like this:
String sess = ${jsession}.
This will be then passed onto the Submit button, maybe I am over-thinking this. Can some veterans point me in the right direction. I appreciate all the effort the veterans take in here. Thank you so much.
If I understand correctly, you just need a hidden field instead of your select box: