aspose file tools*
The moose likes Struts and the fly likes Displaying struts errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying struts errors" Watch "Displaying struts errors" New topic
Author

Displaying struts errors

charu latha
Ranch Hand

Joined: Aug 20, 2002
Posts: 67
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
charu latha
Ranch Hand

Joined: Aug 20, 2002
Posts: 67
Ok i got that done.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Displaying struts errors