java 學(xué)習(xí)

          軟件開(kāi)發(fā)相關(guān)方面的學(xué)習(xí)

          BlogJava 首頁(yè) 新隨筆 聯(lián)系 聚合 管理
            33 Posts :: 1 Stories :: 5 Comments :: 0 Trackbacks
          消息(錯(cuò)誤)顯示

          ActionMessages messages = new ActionMessages();
          messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("userForm.insert", info.getUserName());
          messages.add("activationDate", new ActionMessage("userForm.active", info.getDateLength());

          如下可以顯示所有消息,并用<li>將它們放入一個(gè)list,再加上可定制的header/footer
          <html:messages id="message" header="errors.header" footer="errors.footer">
          <li><bean:write name="message"/></li>
          </html:messages>

          如下可以指定只顯示某種message
          <html:messages id="message" property="<%= org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE %>">
          <li><bean:write name="message"/></li>
          </html:messages>

          <html:messages id="message" property="activationDate">
          <li><bean:write name="message"/></li>
          </html:messages>

          把Messages換成Errors就是錯(cuò)誤顯示,為了簡(jiǎn)便,經(jīng)常一個(gè)<html:errors/>了事
          posted on 2006-06-12 10:07 zxf 閱讀(232) 評(píng)論(0)  編輯  收藏 所屬分類: struts
          主站蜘蛛池模板: 偏关县| 施甸县| 常熟市| 德清县| 封开县| 十堰市| 呼和浩特市| 六枝特区| 阳西县| 新巴尔虎左旗| 水富县| 宁晋县| 上思县| 徐水县| 古浪县| 洪泽县| 女性| 钦州市| 新河县| 西畴县| 集安市| 奎屯市| 友谊县| 合作市| 中阳县| 龙山县| 门头沟区| 鹿邑县| 石阡县| 通渭县| 东宁县| 息烽县| 汉沽区| 涿州市| 莲花县| 连江县| 峡江县| 福鼎市| 四会市| 宜章县| 溆浦县|