You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by de...@struts.apache.org on 2004/04/11 22:45:39 UTC

[Apache Struts Wiki] Updated: StrutsCatalogErrorTypes

   Date: 2004-04-11T13:45:31
   Editor: 80.131.215.242 <>
   Wiki: Apache Struts Wiki
   Page: StrutsCatalogErrorTypes
   URL: http://wiki.apache.org/struts/StrutsCatalogErrorTypes

   some cleanup

Change Log:

------------------------------------------------------------------------------
@@ -1,27 +1,28 @@
- '''Problem'''
- Struts provides { { { ActionMessages/ActionErrors  } } }classes for maintaining a stack of error message to be reported, which can be used with JSP tags like <html: error> to show these message to the user. The problem starts when you have to report different category/severity of message in a different manner. There are two aspects of this problem 
- *  Throwing error message of different { { { category/Severity  } } }
+'''Problem''': Struts provides {{{ ActionMessages/ActionErrors }}} classes for maintaining a stack of error message to be reported, which can be used with JSP tags like <html: error> to show these message to the user. The problem starts when you have to report different category/severity of message in a different manner. There are two aspects of this problem 
+ *  Throwing error message of different {{{ category/Severity }}}
  *  Identifying these messages and showing it in a consistent manner.
 
-Struts { { { ActionErrors  } } }class comes very handy in resolving the first issue of stacking messages of different category. To throw error messages of different category use an interface to define all the different category of message like FATAL, ERROR, WARNING, INFO etc. Then in the Action or { { { ActionForm } } } class you can use 
+Struts {{{ ActionErrors }}} class comes very handy in resolving the first issue of stacking messages of different category. To throw error messages of different category use an interface to define all the different category of message like FATAL, ERROR, WARNING, INFO etc. Then in the Action or {{{ ActionForm }}} class you can use 
 {{{ 
 errors.add("Message.FATAL", new ActionError("...."));
 errors.add("Message.ERROR", new ActionError("...."));
 errors.add("Message.WARN", new ActionError("...."));
 errors.add("Message.INFO", new ActionError("...."));
 
-saveErrors(request,errors)
- }}}
+saveErrors(request,errors);
+
+}}}
 
 Then in the JSP page you can recognize them by 
 
 {{{ 
 <logic:messagePresent property="<%=Action.ERROR_KEY%>"> 
-{{{  <html:messages property="<%=Action.ERROR_KEY%>" id=�error� > 
-    showError(�<bean:write name="error"/>�); // JavaScript Function 
-  </html:messages> }}}
-</logic:messagePresent >
- }}}
+  <html:messages property="<%=Action.ERROR_KEY%>" id="error"> 
+    showError('<bean:write name="error"/>'); // JavaScript Function 
+  </html:messages>
+</logic:messagePresent>
+
+}}}
 
 --Puneet Agarwal
 ----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org