s:iterator value="modules" >
<s:if test='%{type=="student" && str_fmodule=="个人中心"}'>
定义一个具体的type可以
<%String ty= request.getSession().getAttribute("type").toString();%>
jsp页面可以从后台得到type : ty为student
<s:iterator value="modules" >
<s:if test='%{type=="<%=ty%>" && str_fmodule=="个人中心"}'>
这样就不行了,无法执行if
<s:if test='%{type=="student" && str_fmodule=="个人中心"}'>
定义一个具体的type可以
<%String ty= request.getSession().getAttribute("type").toString();%>
jsp页面可以从后台得到type : ty为student
<s:iterator value="modules" >
<s:if test='%{type=="<%=ty%>" && str_fmodule=="个人中心"}'>
这样就不行了,无法执行if
你可以写成<s:if test='%{type=="<s:property value='#session.type'/>" && str_fmodule=="个人中心"}'>
这么写 <s:if test='${type== ty && str_fmodule=="个人中心"}'>