Thanks Joe, I thought it might be a bug, however I wanted more confirmation before logging it. I'll log it in bugzilla.
Cheers Adam On Thu, 3 Mar 2005 09:18 pm, Joe Germuska wrote: > At 4:13 AM -0600 3/3/05, Eddie Bush wrote: > >The redirect is your exact problem. Do something to stop the redirect > >and you'll stop your problem. > > Still, if there are no errors to display, then the headers shouldn't > display either. I have to run, so I may have scanned this too > superficially, but before Eddie's message came in, I had written the > below: > > At 6:39 PM +1100 3/3/05, Adam Jenkins wrote: > >Hi Guys, I'm having some issues with <html:errors/> (I've attached my > > previous mail below) that I'm going to write a custom tag to get around. > > I was thinking that if it's a bug, my effort is probably more > > productively used fixing the bug than rewriting the functionality, but > > first I need to know if it is a bug or not. Can anyone help me out (feel > > free to email me directly for more information)? > > This sounds like a bug to me. Since <html:errors> is still > supported, a Bugzilla post would be appropriate and patches would be > quite welcome! For expediency, you might also look at using > <logic:messagesPresent> and <html:messages> together as an > alternative route to achieve the same results. > > Below is a logical equivalent to <html:errors> Normally when one > uses <html:messages>, you wouldn't put the header/footer/etc in the > message resources but would just put them directly into the page, but > this should be a drop in replacement since you already have that > content in the message resources. > > <logic:messagesPresent> > <bean:message key="errors.header" /> > <html:messages id="msg"> > <bean:message key="errors.prefix" /> > <bean:write name="msg" /> > <bean:message key="errors.suffix" /> > </html:messages> > <bean:message key="errors.footer" /> > </logic:messagesPresent> > > It might be instructive just to see if this behaves differently. > > Joe > > >Cheers > >Adam > > > > > >----previous email------------ > > > > > >Hi Guys, > > > >I'm trying to come to terms with <html:errors/>...it's working ok, I'm > > using the following for prefixes etc: > > > >#error formatting information > >errors.header=<font color="red"><center><p>Some errors occured validating > > the form. Please correct the following errors and try > > again.</p></center><ul> errors.footer=</ul></font> > >errors.prefix=<li> > >errors.suffix=</li> > > > >Which is working great when there are form validation errors, however, to > > get to the page that has the form, I use a global exception redirect as > > such: > > > > <exception > > key="mysite.globalerrors.database_config" > > path="/private/install/ConfigDB.jsp" > > scope="request" > > type="com.mysite.utils.DBMissingConfigDataException"/> > > > >And a tostring on org.apache.struts.action.ERROR = > >{mysite.globalerrors.database_config=[mysite.globalerrors.database_config[ > >The site is not configured correctly: Required database configuration data > > was missing.]]} > > > >Now this is all well and good, except my <html:errors/> tag now prints out > > the header, and footer with one prefix and suffix in between (and no > > error message) when the page first loads (from the error redirect). When > > there is form validation errors everything works fine, however it's just > > that initial redirect where everything goes haywire. > > > >Does anyone know what's going on and/or how to fix? > > > >Cheers > >adam > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]