I am working on the front end of a jsp based app. We’re using spring running on weblogic.
I have a page with a form that submits to itself and I am trying to access the values of hidden fields that I set with javascript.
<form method="post">
<input type="hidden" name="choosenDateFrom" value="test1" />
<input type="hidden" name="choosenDateTo" value="test2" />
.... more code
However when I use the code on the same page:
<c:choose>
<c:when test="${param.choosenDateFrom!=null}">
<c:out value="${param.choosenDateFrom}" />
</c:when>
</c:choose>
The params are not shown on the page. What am I missing? I though this is the standard way of doing this.
Could it be that since we are using a MVC framework I can’t pass params around like this?
Do you have JSTL installed in webapp and declared in JSP?
Check the generated HTML output (open page in browser, choose View Source). It should contain no traces of any JSTL code. If it does, then you likely just need to install JSTL first. Just drop jstl-1.2.jar in webapp’s
/WEB-INF/liband declare the taglib in top of JSP as per the JSTL core TLD:If that still doesn’t solve the problem, then there’s apparently means of a brand new request (i.e. a redirect has occurred), or you were using wrong parameter names. Use
<c:out value="${pageContext.request.parameterMap}" />to see all names.As per your doubt:
That purely depends on which one you’re using. Not mentioning it doesn’t help us to give better answers. But in general the
${param}should be left untouched.