日期:2014-05-17 浏览次数:20734 次
List<NewsForm> newsList; //存放action之间的提示信息 String actionMsg ; public String listNews(){ if (actionMsg!=null)addActionMessage(java.net.URLDecoder.decode(actionMsg)); newsList = service.allNews(); return SUCCESS; }
<s:if test="newsList!=null"> <table border="1"> <tr align="center"> <td> xxx <s:hidden name="news_detail"/> </td> <td> xxxxx </td> <td> xxxxxx </td> <td> xxxxxxxxxxxx </td> <td align="center" colspan=4> 操作 </td> </tr> <s:iterator id="row" value="newsList"> <tr align="center" > <td ><s:property value="news_id"/></td> <td ><s:property value="news_theme"/></td> <td ><s:property value="news_author"/></td> <td ><s:property value="news_date"/></td>
<action name="news_*" class="com.xwxt.action.AllNewsAction" method="{1}"> <!-- 定义名为success的局部result,其结果类型为redirect-action --> <result name="searchAll" type="redirectAction"> <param name="actionName">news_listNews</param> <param name="actionMsg">${actionMsg}</param> </result> <!-- 定义名为success的局部result,其结果类型为默认的dispatcher --> <result>/index.jsp</result>
<result name="searchAll" type="redirectAction">
------解决方案--------------------
<s:if test="newsList!=null">
这样写试试:<s:if test="#request.newsList!=null">
------解决方案--------------------
再写一句
<s:if test="newsList != null"> asdfdasf </s:if>
------解决方案--------------------