在我的行动中:
.....
String status = "add";
servletRequest.setAttribute("button", status);
....
在我的JSP中:
<c:if test='${button == "add"}'>
<c:set var="edittype" value="add" />
</c:if>
<c:if test='${button == "update"}'>
<c:set var="edittype" value="update" />
</c:if>
I have try:
<html:hidden property ="" value="edittype" />
和
<html:hidden property ="" value="${button}" />
和两者都不行。我该怎么做呢?
试试这个:
两种方式1>
<html:hidden property ="reqButtonValue" value="${param.button}" />
<c:if test="${reqButtonValue=='add'}">
<c:set var="edittype" value="add" />
</c:if>
2>
<c:if test="${param.button=='add'}">
<c:set var="edittype" value="add" />
</c:if>