html:errors / ActionErrors bug.

2002-04-16 Thread rob

It would appear that you can not maintain saved errors in the http 
request across a forward to an action before displaying it on a .jsp page.

The following diagram helps to illustrate:
X - action 1
Y - action 2
J - view (jsp page)

X - Y - J

If an ActionErrors instance is created, an ActionError instance is added 
to it and then is saved into the request using saveErrors(request, 
errors) in Action X and then Action X forwards the request to Action Y 
which does something else (not related to errors) and then is forwarded 
to the jsp page J where there is an html:errors / tag the errors no 
longer exist and are lost at this point so far as I can tell.

If the action X forwards directly to page J this does not happen the 
errors are delivered successfully and displayed.

Can anyone tell me a way around this?  It really sucks especially if 
your using an Action to direct requests to dynamic views.

Thanks



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: html:errors / ActionErrors bug.

2002-04-16 Thread Robert Taylor

I don't have a direct answer for you Rob, but what we did was to create a
custom tag that looks for errors in all scopes. Once it is rendered, then it
removes it from all scopes. This allows me to propogate error from page X to
page J by placing them in the session scope. There may be some caveats, but
it has worked pretty well so far.

We are migrating to Struts now and in doing so are starting to use the
html:errors/ tag as well and have run into the same issue you describe.
Maybe it, (html:errors/) could be customized so that it supports the
transitive functionality you and most likely others need. Maybe have an
attribute that defines the scope in which the errors may reside html:errors
scope=[application, session, request, page, all] / with the default being
the request scope.

Once again, sorry for not providing a direct answer, but maybe the ideas
presented above will help.

robert

 -Original Message-
 From: rob [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 16, 2002 11:22 AM
 To: [EMAIL PROTECTED]
 Subject: html:errors / ActionErrors bug.


 It would appear that you can not maintain saved errors in the http
 request across a forward to an action before displaying it on a .jsp page.

 The following diagram helps to illustrate:
 X - action 1
 Y - action 2
 J - view (jsp page)

 X - Y - J

 If an ActionErrors instance is created, an ActionError instance is added
 to it and then is saved into the request using saveErrors(request,
 errors) in Action X and then Action X forwards the request to Action Y
 which does something else (not related to errors) and then is forwarded
 to the jsp page J where there is an html:errors / tag the errors no
 longer exist and are lost at this point so far as I can tell.

 If the action X forwards directly to page J this does not happen the
 errors are delivered successfully and displayed.

 Can anyone tell me a way around this?  It really sucks especially if
 your using an Action to direct requests to dynamic views.

 Thanks



 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: html:errors / ActionErrors bug. (Robert Taylor)

2002-04-16 Thread rob

Thank you for the reply Robert,

Because saveErrors() signature requires the request object I assume that 
the errors object have a request scope and I'm dealing with that 
appropriately.

For the time being your solution is the one I'l have to use (which have 
already been using) but to be consistant and reduce the amount of code I 
have to write it would be preferable to use the errors tag *sad day :(

Just so you know a similar problem exists for multipart/form-data 
posts/requests, they also can not be forwarded through multiple 
Action's.  Though this may have been changed (I'm still using struts 1.01).

Rob


Robert Taylor wrote:
 I don't have a direct answer for you Rob, but what we did was to create a
 custom tag that looks for errors in all scopes. Once it is rendered, then it
 removes it from all scopes. This allows me to propogate error from page X to
 page J by placing them in the session scope. There may be some caveats, but
 it has worked pretty well so far.
 
 We are migrating to Struts now and in doing so are starting to use the
 html:errors/ tag as well and have run into the same issue you describe.
 Maybe it, (html:errors/) could be customized so that it supports the
 transitive functionality you and most likely others need. Maybe have an
 attribute that defines the scope in which the errors may reside html:errors
 scope=[application, session, request, page, all] / with the default being
 the request scope.
 
 Once again, sorry for not providing a direct answer, but maybe the ideas
 presented above will help.
 
 robert
 
 
-Original Message-
From: rob [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 11:22 AM
To: [EMAIL PROTECTED]
Subject: html:errors / ActionErrors bug.


It would appear that you can not maintain saved errors in the http
request across a forward to an action before displaying it on a .jsp page.

The following diagram helps to illustrate:
X - action 1
Y - action 2
J - view (jsp page)

X - Y - J

If an ActionErrors instance is created, an ActionError instance is added
to it and then is saved into the request using saveErrors(request,
errors) in Action X and then Action X forwards the request to Action Y
which does something else (not related to errors) and then is forwarded
to the jsp page J where there is an html:errors / tag the errors no
longer exist and are lost at this point so far as I can tell.

If the action X forwards directly to page J this does not happen the
errors are delivered successfully and displayed.

Can anyone tell me a way around this?  It really sucks especially if
your using an Action to direct requests to dynamic views.

Thanks



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: html:errors / ActionErrors bug.

2002-04-16 Thread Sandeep Takhar

I am wondering if you can set validate=false on the
second mapping (Y)?

maybe because it is going through validation again?

sandeep
--- rob [EMAIL PROTECTED] wrote:
 It would appear that you can not maintain saved
 errors in the http 
 request across a forward to an action before
 displaying it on a .jsp page.
 
 The following diagram helps to illustrate:
 X - action 1
 Y - action 2
 J - view (jsp page)
 
 X - Y - J
 
 If an ActionErrors instance is created, an
 ActionError instance is added 
 to it and then is saved into the request using
 saveErrors(request, 
 errors) in Action X and then Action X forwards the
 request to Action Y 
 which does something else (not related to errors)
 and then is forwarded 
 to the jsp page J where there is an html:errors /
 tag the errors no 
 longer exist and are lost at this point so far as I
 can tell.
 
 If the action X forwards directly to page J this
 does not happen the 
 errors are delivered successfully and displayed.
 
 Can anyone tell me a way around this?  It really
 sucks especially if 
 your using an Action to direct requests to dynamic
 views.
 
 Thanks
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: html:errors / ActionErrors bug.

2002-04-16 Thread rob

Neither of the Actions use validation.  The attribute is not even 
defined in the struts-config.xml for the actions.

The actual struts-config.xml entries for the two actions are:


action path=/viewResource
 type=gen.ViewResourceAction
 name=ViewResourceForm
 scope=request

 forward name=Composites
 path=/do/viewComposite/
/action


action path=/viewComposite
 type=gen.ViewCompositeAction
 name=ViewResourceForm
 scope=request

 forward name=view/Composite
 path=/WEB-INF/pages/viewComposite.jsp/
/action


The actual flow is as follows:
- make a request to viewResource
- forward to viewComposite (which is where the error is generated and
   saveErrors(request, errors) is called and query string parameters
   are changed.
- it is then forwarded to viewResource again (but with the different
   parameters)
- then forward viewComposite again which (no new errors occur this
   time)
- then forwards to viewComposite.jsp where the error message should
   appear but by this time the html:errors/ don't seem to have anything
   in them.

I've triple checked to ensure that no more errors are effecting the 
request after the initial errors are added and it all happens in a 
single request.


Sandeep Takhar wrote:
 I am wondering if you can set validate=false on the
 second mapping (Y)?
 
 maybe because it is going through validation again?
 
 sandeep
 --- rob [EMAIL PROTECTED] wrote:
 
It would appear that you can not maintain saved
errors in the http 
request across a forward to an action before
displaying it on a .jsp page.

The following diagram helps to illustrate:
X - action 1
Y - action 2
J - view (jsp page)

X - Y - J

If an ActionErrors instance is created, an
ActionError instance is added 
to it and then is saved into the request using
saveErrors(request, 
errors) in Action X and then Action X forwards the
request to Action Y 
which does something else (not related to errors)
and then is forwarded 
to the jsp page J where there is an html:errors /
tag the errors no 
longer exist and are lost at this point so far as I
can tell.

If the action X forwards directly to page J this
does not happen the 
errors are delivered successfully and displayed.

Can anyone tell me a way around this?  It really
sucks especially if 
your using an Action to direct requests to dynamic
views.

Thanks



--
To unsubscribe, e-mail:  
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

 
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]