$ {param.type}是我从一个jsp发送到包含的jsp的变量。如何使用Struts中的字符串测试jsp param参数?
我想,他们的
<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
编辑2控制:
这里是回答的一个步骤。 http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-params-properly.html参数位于Struts2的Map中。然而我的type
帕拉姆没有在请求我认为struts2不能看到它后首先请求参数设置。
道道告诉你,你在包括JSP发送帕拉姆的代码? – 2011-03-21 16:27:03
不太熟悉struts,但你可以通过'<%= request.getParameter(“type”)%>'来检查值是否在请求中。 – gmedina 2011-03-21 22:50:26