struts1.x-学习札记四

struts1.x--学习笔记四
5. 显示错误的两种方式
       
        5.1 直接显示 <html:errors/>
       
        5.2 使用message 标签来显示 使用这个方式的话,那么错误是存放在request中的.
                <html:messages id="msg">
                        ${msg}
                </html:messages>
               
6. 若想调用配置文件中的信息
       
        6.1 使用 <bean:message key="message.xxx"> message.xxx就是资源文件中配置的KEY.

7. 资源文件的配置
       
        <message-resources parameter="com.tarena.Message"/>
               
三  两个重要的tag

1. <%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>   ------------- important

        <bean:message key="message.name"/> 可以在页面中显示资源文件中对应key的值
       
2. <%@taglib uri="http://struts.apache.org/tags-html prefix="html"%>
       
        多用于显示错误信息