0

在我的行动中:

.....
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>

我努力了:

<html:hidden property ="" value="edittype" />

<html:hidden property ="" value="${button}" /> 

也没有工作。我该怎么做呢?

4

1 回答 1

0

尝试这个 :

两种方式

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>
于 2013-01-09T14:16:34.943 回答