在标记struts中设置Request变量

时间:2013-01-09 14:03:26

标签: struts

在我的行动中:

.....
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}" /> 

并且没有工作。我该怎么做?

1 个答案:

答案 0 :(得分:0)

试试这个:

两种方式

1&GT;

    <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>
相关问题