0

${param.type} 是我将它从一个 jsp 发送到包含的 jsp 的变量。

我试过了

<s:if test="${param.type} == 'message_error'">

或者

<s:if test="'message_error'.equas(${param.type})">

它们都不起作用。我如何用struts检查它?

编辑1:

我这样发送参数:

<jsp:include page="/file.jsp">
    <jsp:param name="type" value="message_error"/>
</jsp:include>

我将在 file.jsp 中进行 struts 控制

编辑2:

这是回答的一步。http://struts.apache.org/2.x/docs/why-doesnt-the-if ​​-tag-evaluate-params-properly.html 参数位于 Struts2 的地图中。但是我的type参数不是在请求我认为 struts2 在首先设置请求参数后看不到它。

4

1 回答 1

0

也尝试这样的事情

<s:if test='%{(param.type) == "message_error"}'>
于 2011-03-21T16:41:47.597 回答