Can not read the request.getParameter()

Hello All,

I am trying to read the request.getParameter(). I am setting the default value to 2, if request.getParameter() is empty. If I select some other day, getParameter still shows 2 instead of selected day say 4 or 4. In the debug output, DefaultStartDay is displaying only 2 all the time.

Please let me know what I am doing wrong?.

here are the two codes.

AccountStatus.jsp: this is where I am setting the default value and reading it in ReportStartDay.

<%

String ReportStartDay = request.getParameter("ReportStartDay");

/*if (ReportStartDay == null){

out.println("<br>");

out.println("ReportStartDay: " + ReportStartDay);

out.println("<br>");

}

else

out.println("ReportStartDay Not null: " + ReportStartDay);

*/

%>

<%--set the ReportStartDay default value--%>

<c:set var="DefaultStartDay" value="2"/>

<%-- // set value from request parameter if present--%>

<c:if test="${not empty param.ReportStartDay}">

<c:set var="DefaultStartDay" value="${param.ReportStartDay}"/>

</c:if>

--

In the included page I have following code.

<select name="ReportStartDay" size="1">

<c:forEach var="val" begin="1" end="31" step="1">

<option value="${DefaultStartDay}" ${(DefaultStartDay == val) ? 'selected' : ''} ><c:out value="${val}" />

</c:forEach>

</select>

-

[1531 byte] By [lsd4600a] at [2007-11-26 17:39:55]
# 1

you are not closing the option. Should be this:

<c:forEach var="val" begin="1" end="31" step="1">

<option value="${DefaultStartDay}" ${(DefaultStartDay == val) ? 'selected' : ''} ><c:out value="${val}" /></option>

</c:forEach>

gimbal2a at 2007-7-9 0:08:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
After closing the option tag still, it does not work.anybody has any idea.thanks..lax..
lsd4600a at 2007-7-9 0:08:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
It was a variable mistake instead of ${val} I was using DefaultStartDay. It is working fine.thanks guys..
lsd4600a at 2007-7-9 0:08:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...