struts
2013-01-09 22 views 0 likes 
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}" /> 

和其他工作。我该怎么做呢?

回答

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> 
+0

不,我得到: mike628

+0

@ mike628然后,您并未在JSP 2.0容器中运行;使用EL标签库。 –

+0

当我这样做:我可以访问该值 – mike628

相关问题