Hi,
I have a
jsp page that has an action class which talks to a form bean which does the validation for my page and returns ActionErrors object. I want to display the errors in my jsp page all in one location after a few lines of text.
For instance suppose my html were like this:
<%@ include file="../../common/include/ZdUserDetails.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:html locale="true">
head>
<title>ZeroDegrees</title>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<html:form method="post" action="/register" name="registerForm" type="com.zerodegrees.struts.forms.auth.RegisterFormBean">
<div align="center">
<table cellspacing="0" cellpadding="1" width="776" summary="" bgcolor="#2D81B5" border="0">
<tbody>
<tr>
<td height="59"><img alt="" height="69" src="<%=sitePath%>/cobrand/<%=strCoBrandId%>/images/header.gif" width="774" usemap="#header_map" border="0" /></td>
</tr>
</tbody>
</table>
</div>
<table cellspacing="0" cellpadding="0" width="775" align="center" summary="" border="0">
<tbody>
<tr>
<td bgcolor="#003366"><img alt="" height="1" src="" width="1" /></td>
<td class="clbgwhite" valign="top" bgcolor="#FFFFFF">
<span></span>
<table cellspacing="0" cellpadding="10" width="750" border="0" summary="" align="center">
<tbody>
<tr>
<td width="1003" bgcolor="#ffffff" height="2"><b>xxxxxxxxxxxxxx<br />
<br /> </b> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
br /><br />
Already a member? Click <a href="#">here</a> to login.
</td>
</tr>
</tbody>
</table>
After the above table i want to print all the errors that have been raised in the page. Ideally i am planning on something like:
<logic:messagesPresent>
<iterator> ----- iterate through all the messages and display it
</iterator>
</logic:messagesPresent>
Is this possible. Or am i doing it the hard way?
Thanks