How to assign a hidden value to a JSTL variable?

How to assign a hidden value to a JSTL variable?

Example:

<input type="hidden" name="userName" value="Administrator" />
<c:set var="user" value="" />  // How do I set hidden variable value (Administrator) here?
+1
source share
1 answer

I assume that you really mean, “How do I assign a hidden input value sent for the JSTL variable?” Because the question you are specifying now does not make sense. You can simply copy the value to the tag.

You can access the parameters implicit EL-request object ${param}, which can be accessed, for example Map.

<c:set var="user" value="${param.userName}" />

Behind the scenes, this assigns the result to a request.getParameter("userName")variable name userin the page area.


, . , Javabeans ?

. :

+5

Source: https://habr.com/ru/post/1760366/


All Articles