Set var value from input field value

I started a short time with JSP, JSTL, HTML and JavaScript, so here is my problem:

I need to set var value for hidden input value. Another option is the ability to compare using

<c:if test="....">

the value of the variable that I sent with the request with the value of the hidden input.

Thanks.

Update

I try, but cannot make it work.

I have this field that contains an identifier and an object. I also have a list of objects, so I need to find the object associated with this identifier.

<input type="text" name="id1" />

but if I do this:

<c:set var="dd" value="${param.id1}" />
<input type="text" value="${dd}" />

The input text is empty, but the text related to id1 displays 850 (i.e. the value is dynamic)

Any suggestion why it is not working?

Update 2

"multipart/form-data", . , Java, , JSP, ? .

+5
1

${param}.

. http://example.com/context/page.jsp?foo=bar

<c:if test="${param.foo == 'bar'}">
   The foo param value is bar!
</c:if>
<c:if test="${param.foo != 'bar'}">
   The foo param value is not bar, it is: ${param.foo}
</c:if>

.

( ), :

<input type="hidden" name="foo" value="${param.foo}">

: : . , ,

<input type="text" name="id1" value="${param.id1}" />

, request.getParameter("id1") ${param.id1}. ?

2: : , enctype="multipart/form-data". , - ( ). , , . 2.5 , Apache Commons FileUpload. " " " ", ( MSIE!). FileUpload, HttpServletRequest#getParameter() ${param}, . .

Servlet 3.0, HttpServletRequest#getParts(). , HttpServletRequest#getParameter() ${param}, . .

3: , JSP . . Servlet. , Filter, ( ), Servlet.

+3

All Articles