You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rob <ro...@fastmail.fm> on 2002/04/16 17:22:09 UTC
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to get ActionForward for input ?
Posted by rob <ro...@fastmail.fm>.
From your perform() method
return new ActionForward(mapping.getInput());
Providing you defined the input="foo.jsp" attribute in your <action ...
/> in struts-config.xml.
Nicolas De Loof wrote:
> In an action, how to forward the user to the input page ?
>
> ActionMapping.findForward("input") doesn't has a ActionForward for this.
> I use :
>
> RequestDispatcher rd
> = request.getRequestDispatcher(mapping.getInput());
> rd.forward(request, response);
>
> Is there a better way ?
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
How to get ActionForward for input ?
Posted by Nicolas De Loof <ni...@cgey.com>.
In an action, how to forward the user to the input page ?
ActionMapping.findForward("input") doesn't has a ActionForward for this.
I use :
RequestDispatcher rd
= request.getRequestDispatcher(mapping.getInput());
rd.forward(request, response);
Is there a better way ?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug.
Posted by Sandeep Takhar <sa...@yahoo.com>.
i still think that it blanks out the action errors.
maybe someone else can shed some light
sandeep
--- rob <ro...@fastmail.fm> wrote:
> Setting the validation parameter to true as I
> understand only results in the
> ActionForm bean's validate() method to be called
> since I'm not using the
> ActionForm bean's validate() method it shouldn't be
> necessary.
>
> Rob
> At 04:45 AM 4/17/2002 -0700, you wrote:
> >I am not sure what the default is, but it is a good
> >idea to explicitly set the validate parameter.
> >
> >You also need to set a parameter on the action
> servlet
> >to indicate that validation should be turned on.
> >
> >You may need an additional action-mapping as well
> >according to your example below.
> >
> >Basically whenever you call a url, the validation
> may
> >or may not be called depending on its validate
> >parameter. I think the action errors is blanked
> out
> >before every url call.
> >
> >Someone else may be able to help more.
> >
> >sandeep
> >--- rob <ro...@fastmail.fm> wrote:
> >> 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 <ro...@fastmail.fm> 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:
> >>
>
>>><ma...@jakarta.apache.org>
> >> >>For additional commands, e-mail:
> >> >><ma...@jakarta.apache.org>
> >> >>
> >> >
> >> >
> >> >
> __________________________________________________
> >> > Do You Yahoo!?
> >> > Yahoo! Tax Center - online filing with TurboTax
> >> > http://taxes.yahoo.com/
> >> >
> >> > --
> >> > To unsubscribe, e-mail:
> >>
> <ma...@jakarta.apache.org>
> >> > For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >> >
> >> >
> >>
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >>
> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! Tax Center - online filing with TurboTax
> >http://taxes.yahoo.com/
> >
> >--
> >To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug.
Posted by rob <ro...@fastmail.fm>.
Setting the validation parameter to true as I understand only results in the
ActionForm bean's validate() method to be called since I'm not using the
ActionForm bean's validate() method it shouldn't be necessary.
Rob
At 04:45 AM 4/17/2002 -0700, you wrote:
>I am not sure what the default is, but it is a good
>idea to explicitly set the validate parameter.
>
>You also need to set a parameter on the action servlet
>to indicate that validation should be turned on.
>
>You may need an additional action-mapping as well
>according to your example below.
>
>Basically whenever you call a url, the validation may
>or may not be called depending on its validate
>parameter. I think the action errors is blanked out
>before every url call.
>
>Someone else may be able to help more.
>
>sandeep
>--- rob <ro...@fastmail.fm> wrote:
>> 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 <ro...@fastmail.fm> 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:
>>
>>><ma...@jakarta.apache.org>
>> >>For additional commands, e-mail:
>> >><ma...@jakarta.apache.org>
>> >>
>> >
>> >
>> > __________________________________________________
>> > Do You Yahoo!?
>> > Yahoo! Tax Center - online filing with TurboTax
>> > http://taxes.yahoo.com/
>> >
>> > --
>> > To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> > For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>> >
>> >
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug.
Posted by Sandeep Takhar <sa...@yahoo.com>.
I am not sure what the default is, but it is a good
idea to explicitly set the validate parameter.
You also need to set a parameter on the action servlet
to indicate that validation should be turned on.
You may need an additional action-mapping as well
according to your example below.
Basically whenever you call a url, the validation may
or may not be called depending on its validate
parameter. I think the action errors is blanked out
before every url call.
Someone else may be able to help more.
sandeep
--- rob <ro...@fastmail.fm> wrote:
> 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 <ro...@fastmail.fm> 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:
>
>><ma...@jakarta.apache.org>
> >>For additional commands, e-mail:
> >><ma...@jakarta.apache.org>
> >>
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Tax Center - online filing with TurboTax
> > http://taxes.yahoo.com/
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug.
Posted by rob <ro...@fastmail.fm>.
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 <ro...@fastmail.fm> 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:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug.
Posted by Sandeep Takhar <sa...@yahoo.com>.
I am wondering if you can set validate=false on the
second mapping (Y)?
maybe because it is going through validation again?
sandeep
--- rob <ro...@fastmail.fm> 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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: ActionErrors bug. (Robert Taylor)
Posted by rob <ro...@fastmail.fm>.
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:rob_mail@fastmail.fm]
>>Sent: Tuesday, April 16, 2002 11:22 AM
>>To: struts-user@jakarta.apache.org
>>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:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: ActionErrors bug.
Posted by Robert Taylor <rt...@mulework.com>.
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:rob_mail@fastmail.fm]
> Sent: Tuesday, April 16, 2002 11:22 AM
> To: struts-user@jakarta.apache.org
> 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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>