You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Collings <jl...@gmail.com> on 2009/09/10 20:49:34 UTC

Chain a global result to an action?

Anybody know what the syntax for this is?  I don't seem to be getting it right.


Jim C.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Chain a global result to an action?

Posted by ragu <ke...@yahoo.com>.
Im facing the same issue, has anybody arrived at a solution or found a 
way to resolve this issue ???





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Chain a global result to an action?

Posted by ManiKanta G <go...@gmail.com>.
Hi,

I m facing the same problem, and I've posted to list.

Please follow for any updates:
http://www.nabble.com/Problem-with-result-returning-from-interceptor-td25075486.html

Regards,
ManiKanta G
twitter.com/manikantag


On Fri, Sep 11, 2009 at 1:10 AM, Bill Bohnenberger <bi...@gmail.com>wrote:

> I'll let someone else answer this... I've not jet used the convention
> plugin
> (too bleeding edge for me! :)
>
> On Thu, Sep 10, 2009 at 12:11 PM, Jim Collings <jl...@gmail.com>
> wrote:
>
> > I also forgot to mention that this is a convention-plugin project.
> >
> > On Thu, Sep 10, 2009 at 3:10 PM, Jim Collings <jl...@gmail.com>
> wrote:
> > > Will I have to define the action in the struts.xml?  I'm currently
> > > using annotations to handle mapping.
> > >
> > > Jim C.
> > >
> > >> This works for me:
> > >>
> > >> <struts>
> > >>    <package ...
> > >>
> > >>        <global-results>
> > >>            <result name="error" type="redirect">DeadEnd</result>
> > >>        </global-results>
> > >>
> > >>    ...
> > >>        <action name="DeadEnd" class="com.rp.db.actions.DeadEnd">
> > >>            <result>deadEnd.jsp</result>
> > >>        </action>
> > >>
> > >>    ...
> > >>    </package>
> > >> </struts>
> > >>
> > >> The entire action class is:
> > >>
> > >> @SuppressWarnings("serial")
> > >> public class DeadEnd extends ActionSupport
> > >> {
> > >>
> > >> }
> > >>
> > >> and when any action returns "error" the deadEnd.jsp page is displayed.
> > >>
> > >> - Bill
> > >>
> > >> On Thu, Sep 10, 2009 at 11:49 AM, Jim Collings <jl...@gmail.com>
> > wrote:
> > >>
> > >>> Anybody know what the syntax for this is?  I don't seem to be getting
> > it
> > >>> right.
> > >>>
> > >>>
> > >>> Jim C.
> > >>>
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>> For additional commands, e-mail: user-help@struts.apache.org
> > >>>
> > >>>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: Chain a global result to an action?

Posted by Bill Bohnenberger <bi...@gmail.com>.
I'll let someone else answer this... I've not jet used the convention plugin
(too bleeding edge for me! :)

On Thu, Sep 10, 2009 at 12:11 PM, Jim Collings <jl...@gmail.com> wrote:

> I also forgot to mention that this is a convention-plugin project.
>
> On Thu, Sep 10, 2009 at 3:10 PM, Jim Collings <jl...@gmail.com> wrote:
> > Will I have to define the action in the struts.xml?  I'm currently
> > using annotations to handle mapping.
> >
> > Jim C.
> >
> >> This works for me:
> >>
> >> <struts>
> >>    <package ...
> >>
> >>        <global-results>
> >>            <result name="error" type="redirect">DeadEnd</result>
> >>        </global-results>
> >>
> >>    ...
> >>        <action name="DeadEnd" class="com.rp.db.actions.DeadEnd">
> >>            <result>deadEnd.jsp</result>
> >>        </action>
> >>
> >>    ...
> >>    </package>
> >> </struts>
> >>
> >> The entire action class is:
> >>
> >> @SuppressWarnings("serial")
> >> public class DeadEnd extends ActionSupport
> >> {
> >>
> >> }
> >>
> >> and when any action returns "error" the deadEnd.jsp page is displayed.
> >>
> >> - Bill
> >>
> >> On Thu, Sep 10, 2009 at 11:49 AM, Jim Collings <jl...@gmail.com>
> wrote:
> >>
> >>> Anybody know what the syntax for this is?  I don't seem to be getting
> it
> >>> right.
> >>>
> >>>
> >>> Jim C.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Chain a global result to an action?

Posted by Jim Collings <jl...@gmail.com>.
I also forgot to mention that this is a convention-plugin project.

On Thu, Sep 10, 2009 at 3:10 PM, Jim Collings <jl...@gmail.com> wrote:
> Will I have to define the action in the struts.xml?  I'm currently
> using annotations to handle mapping.
>
> Jim C.
>
>> This works for me:
>>
>> <struts>
>>    <package ...
>>
>>        <global-results>
>>            <result name="error" type="redirect">DeadEnd</result>
>>        </global-results>
>>
>>    ...
>>        <action name="DeadEnd" class="com.rp.db.actions.DeadEnd">
>>            <result>deadEnd.jsp</result>
>>        </action>
>>
>>    ...
>>    </package>
>> </struts>
>>
>> The entire action class is:
>>
>> @SuppressWarnings("serial")
>> public class DeadEnd extends ActionSupport
>> {
>>
>> }
>>
>> and when any action returns "error" the deadEnd.jsp page is displayed.
>>
>> - Bill
>>
>> On Thu, Sep 10, 2009 at 11:49 AM, Jim Collings <jl...@gmail.com> wrote:
>>
>>> Anybody know what the syntax for this is?  I don't seem to be getting it
>>> right.
>>>
>>>
>>> Jim C.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Chain a global result to an action?

Posted by Jim Collings <jl...@gmail.com>.
Will I have to define the action in the struts.xml?  I'm currently
using annotations to handle mapping.

Jim C.

> This works for me:
>
> <struts>
>    <package ...
>
>        <global-results>
>            <result name="error" type="redirect">DeadEnd</result>
>        </global-results>
>
>    ...
>        <action name="DeadEnd" class="com.rp.db.actions.DeadEnd">
>            <result>deadEnd.jsp</result>
>        </action>
>
>    ...
>    </package>
> </struts>
>
> The entire action class is:
>
> @SuppressWarnings("serial")
> public class DeadEnd extends ActionSupport
> {
>
> }
>
> and when any action returns "error" the deadEnd.jsp page is displayed.
>
> - Bill
>
> On Thu, Sep 10, 2009 at 11:49 AM, Jim Collings <jl...@gmail.com> wrote:
>
>> Anybody know what the syntax for this is?  I don't seem to be getting it
>> right.
>>
>>
>> Jim C.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: excpetion chaining to custom exception handler issue

Posted by Denny Erinjery <de...@timelink.com>.
Hi all,
The following is the exception I'm getting while the user try to refresh my error page


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

Infinite recursion detected: [//loginAction!login, //UnhandledExceptionHandler, //UnhandledExceptionHandler, //UnhandledExceptionHandler] - [unknown location]
	com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:203)
	com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
	org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
	org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)


My tomcat server shows the following in the log 

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
	at org.apache.catalina.connector.Response.getWriter(Response.java:610)
	at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
	at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
	at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)
	at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:326)
	at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:342)
	at org.apache.struts2.components.Property.start(Property.java:143)
	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
	at org.apache.jsp.jsp.systemerror_jsp._jspx_meth_s_005fproperty_005f5(systemerror_jsp.java:1225)
	at org.apache.jsp.jsp.systemerror_jsp._jspService(systemerror_jsp.java:628)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
	at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
	at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
	at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)



thanks,
--Denny


-----Original Message-----
From: Denny Erinjery [mailto:denny.erinjery@timelink.com] 
Sent: Wednesday, September 16, 2009 9:49 AM
To: Struts Users Mailing List
Subject: RE: excpetion chaining to custom exception handler issue

Hi Wes,
Appreciate your reply, thanks for checking the issue. I'm sure that my exception handling action class is not throwing an exception by itself. I have a general try-catch on that and it never falls to there. Actually the issue of chaining happens a little after that.. 
Let me explain
I have a login action class which throws a cast exception for some session object. Now my struts xml defined a global exception mapping as follows
        <global-results>
			<result name="Excpetion" type="chain">
				<param name="actionName">UnhandledExceptionHandler</param>
			</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception="java.lang.Exception" result="Excpetion"/>
        </global-exception-mappings>


	<action name="UnhandledExceptionHandler" class="com.timelink.falco.wui.struts.handlers.GlobalException">
	            <result name="error" type="dispatcher">/jsp/systemerror.jsp</result>
	</action>

The above config works, I mean the exception from my login action class is transferred to my -  GlobalException - exception handling class and the systemerror.jsp get displayed properly.

The problem is once this page gets displayed with data , now if the user goes and refresh this page from the browser, things getting wired!!

Frist thing is , even though the current displayed page is systemerror.jsp,
my url still points to the last class where the actual exception occurs (loginAction). I think this is because of chaining. 
Second, after the user did a refresh, it goes through the same path, it starts from the login action class -> the loin action throws the cast exception (java.lang subtype exception) -> my global redirect calls my GlobalException  handler class execute method and return the result error as exactly as last time, but after that, this time instead of displaying the systemerror.jsp it will go to the Struts 500 infinite recursion error!!

Now if the user refresh that error page(struts 500) the same things happens as above and this time my  systemerror.jsp shows up, now you refresh that again it goes to struts 500, this is the sequence. All of the above refresh always goes through the exception generation process(starts from loginAction class) since the url always set to loginAction class.

I hope that explains it well. Please let me know where do I have to look for more info. I tried to branch those actions into 2 part action - like the global exception does the chain to my exception handling class (where I save the current exception state) and after it returns , instead of displaying the systemerror.jsp straight, I redirect that error result to another action class(this time using "redirectAction")
So that the url get set to the exception url, but that also not helping me much. Even though the url set to exception handler, a refresh on that still shows struts 500 error.

Thanks for all help guys..
-Denny


  


-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Friday, September 11, 2009 1:32 PM
To: Struts Users Mailing List
Subject: Re: excpetion chaining to custom exception handler issue

Your exception mapping is likely throwing an exception then... think
of it like this -

1 Action gets invoked
2  Oh-No! an exception -> go to the exception page
3 Exception page invoked
4  Oh-No! an exception -> go to #2

Xwork's chain result explicitly checks that an infinite chain sequence
isn't happening. That's more or less the only thing the chain result
checks, so I would make sure this isn't the case.

-Wes

On Fri, Sep 11, 2009 at 1:23 PM, Denny Erinjery
<de...@timelink.com> wrote:
> Anybody have any ides about this??
> I try to do an additional action class with  redirectAction after the
> first chaining using a second action to avoid the 500 error but that
> didn't help me, debugging into the ActionChain interceptor from xworks
> shows that it went to an infinte error  after checking the
> chaininghistory
> Thanks
>
>
> -----Original Message-----
> From: Denny Erinjery [mailto:denny.erinjery@timelink.com]
> Sent: Thursday, September 10, 2009 3:04 PM
> To: Struts Users Mailing List
> Subject: excpetion chaining to custom exception handler issue
>
> HI,
> I'm using a global exception handler action class to get the exception
> details and display it on a custom error page.
> Following is the struts xml configuration
>        <global-results>
>                        <result name="Excpetion" type="chain">
>                                <param
> name="actionName">UnhandledExceptionHandler</param>
>                                <!-- param
> name="namespace">/namespaceWhereActionIsDefined</param -->
>                        </result>
>        </global-results>
>
>        <global-exception-mappings>
>            <exception-mapping exception=3D"java.lang.Exception"
> result="Excpetion"/>
>        </global-exception-mappings>
>
>
>        <action name="UnhandledExceptionHandler"
> class="com.timelink.falco.wui.struts.handlers.GlobalException">
>                    <result name=3D"error"
> type="dispatcher">/jsp/systemerror.jsp</result>
>
>        </action>
>
> Once my action class is invoked it will create my exception object using
> the current exception set by the struts setter as well as I get more
> details about the system at the time of the exception. In order to get
> the exception forwarded to my action class from the action where the
> exception occurs I use chaining in the result mapping
>        "<global-results>
>                        <result name="Excpetion" type="chain"> .... "
> This works and everything is populated on my error jsp page and the page
> gets displayed as expected. Now if I refresh this error page, although
> the actions go through the last exception path as expected, and my error
> handler class is executed, it will not display the error page again this
> time but will end up showing the following error=
>
> HTTP Status 500 - Infinite recursion detected: [//loginAction!login,
> //UnhandledExceptionHandler, //UnhandledExceptionHandler,
> //UnhandledExceptionHandler] - [unknown location]
> com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java
> :203)
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
> ionInvocation.java:361)
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
> cation.java:265)
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java
> :52)
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
> 68)
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:395)
>
> After this error if I refresh the above page(HTTP Status 500) , it will
> once again show my error page and a refresh on that page will bring back
> the error 500 again!!! This keeps on doing on consecutive refresh. This
> will go away if I use "redierctAction" in place of "chain" but then I
> will lost the information about the exception once it reached in my
> exception handling action class Please tell me is this a problem on my
> error handling or a sturts issue.
>
> Thanks
> Denny
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: excpetion chaining to custom exception handler issue

Posted by Denny Erinjery <de...@timelink.com>.
Hi Wes,
Appreciate your reply, thanks for checking the issue. I'm sure that my exception handling action class is not throwing an exception by itself. I have a general try-catch on that and it never falls to there. Actually the issue of chaining happens a little after that.. 
Let me explain
I have a login action class which throws a cast exception for some session object. Now my struts xml defined a global exception mapping as follows
        <global-results>
			<result name="Excpetion" type="chain">
				<param name="actionName">UnhandledExceptionHandler</param>
			</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception="java.lang.Exception" result="Excpetion"/>
        </global-exception-mappings>


	<action name="UnhandledExceptionHandler" class="com.timelink.falco.wui.struts.handlers.GlobalException">
	            <result name="error" type="dispatcher">/jsp/systemerror.jsp</result>
	</action>

The above config works, I mean the exception from my login action class is transferred to my -  GlobalException - exception handling class and the systemerror.jsp get displayed properly.

The problem is once this page gets displayed with data , now if the user goes and refresh this page from the browser, things getting wired!!

Frist thing is , even though the current displayed page is systemerror.jsp,
my url still points to the last class where the actual exception occurs (loginAction). I think this is because of chaining. 
Second, after the user did a refresh, it goes through the same path, it starts from the login action class -> the loin action throws the cast exception (java.lang subtype exception) -> my global redirect calls my GlobalException  handler class execute method and return the result error as exactly as last time, but after that, this time instead of displaying the systemerror.jsp it will go to the Struts 500 infinite recursion error!!

Now if the user refresh that error page(struts 500) the same things happens as above and this time my  systemerror.jsp shows up, now you refresh that again it goes to struts 500, this is the sequence. All of the above refresh always goes through the exception generation process(starts from loginAction class) since the url always set to loginAction class.

I hope that explains it well. Please let me know where do I have to look for more info. I tried to branch those actions into 2 part action - like the global exception does the chain to my exception handling class (where I save the current exception state) and after it returns , instead of displaying the systemerror.jsp straight, I redirect that error result to another action class(this time using "redirectAction")
So that the url get set to the exception url, but that also not helping me much. Even though the url set to exception handler, a refresh on that still shows struts 500 error.

Thanks for all help guys..
-Denny


  


-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Friday, September 11, 2009 1:32 PM
To: Struts Users Mailing List
Subject: Re: excpetion chaining to custom exception handler issue

Your exception mapping is likely throwing an exception then... think
of it like this -

1 Action gets invoked
2  Oh-No! an exception -> go to the exception page
3 Exception page invoked
4  Oh-No! an exception -> go to #2

Xwork's chain result explicitly checks that an infinite chain sequence
isn't happening. That's more or less the only thing the chain result
checks, so I would make sure this isn't the case.

-Wes

On Fri, Sep 11, 2009 at 1:23 PM, Denny Erinjery
<de...@timelink.com> wrote:
> Anybody have any ides about this??
> I try to do an additional action class with  redirectAction after the
> first chaining using a second action to avoid the 500 error but that
> didn't help me, debugging into the ActionChain interceptor from xworks
> shows that it went to an infinte error  after checking the
> chaininghistory
> Thanks
>
>
> -----Original Message-----
> From: Denny Erinjery [mailto:denny.erinjery@timelink.com]
> Sent: Thursday, September 10, 2009 3:04 PM
> To: Struts Users Mailing List
> Subject: excpetion chaining to custom exception handler issue
>
> HI,
> I'm using a global exception handler action class to get the exception
> details and display it on a custom error page.
> Following is the struts xml configuration
>        <global-results>
>                        <result name="Excpetion" type="chain">
>                                <param
> name="actionName">UnhandledExceptionHandler</param>
>                                <!-- param
> name="namespace">/namespaceWhereActionIsDefined</param -->
>                        </result>
>        </global-results>
>
>        <global-exception-mappings>
>            <exception-mapping exception=3D"java.lang.Exception"
> result="Excpetion"/>
>        </global-exception-mappings>
>
>
>        <action name="UnhandledExceptionHandler"
> class="com.timelink.falco.wui.struts.handlers.GlobalException">
>                    <result name=3D"error"
> type="dispatcher">/jsp/systemerror.jsp</result>
>
>        </action>
>
> Once my action class is invoked it will create my exception object using
> the current exception set by the struts setter as well as I get more
> details about the system at the time of the exception. In order to get
> the exception forwarded to my action class from the action where the
> exception occurs I use chaining in the result mapping
>        "<global-results>
>                        <result name="Excpetion" type="chain"> .... "
> This works and everything is populated on my error jsp page and the page
> gets displayed as expected. Now if I refresh this error page, although
> the actions go through the last exception path as expected, and my error
> handler class is executed, it will not display the error page again this
> time but will end up showing the following error=
>
> HTTP Status 500 - Infinite recursion detected: [//loginAction!login,
> //UnhandledExceptionHandler, //UnhandledExceptionHandler,
> //UnhandledExceptionHandler] - [unknown location]
> com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java
> :203)
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
> ionInvocation.java:361)
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
> cation.java:265)
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java
> :52)
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
> 68)
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:395)
>
> After this error if I refresh the above page(HTTP Status 500) , it will
> once again show my error page and a refresh on that page will bring back
> the error 500 again!!! This keeps on doing on consecutive refresh. This
> will go away if I use "redierctAction" in place of "chain" but then I
> will lost the information about the exception once it reached in my
> exception handling action class Please tell me is this a problem on my
> error handling or a sturts issue.
>
> Thanks
> Denny
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: excpetion chaining to custom exception handler issue

Posted by Wes Wannemacher <we...@wantii.com>.
Your exception mapping is likely throwing an exception then... think
of it like this -

1 Action gets invoked
2  Oh-No! an exception -> go to the exception page
3 Exception page invoked
4  Oh-No! an exception -> go to #2

Xwork's chain result explicitly checks that an infinite chain sequence
isn't happening. That's more or less the only thing the chain result
checks, so I would make sure this isn't the case.

-Wes

On Fri, Sep 11, 2009 at 1:23 PM, Denny Erinjery
<de...@timelink.com> wrote:
> Anybody have any ides about this??
> I try to do an additional action class with  redirectAction after the
> first chaining using a second action to avoid the 500 error but that
> didn't help me, debugging into the ActionChain interceptor from xworks
> shows that it went to an infinte error  after checking the
> chaininghistory
> Thanks
>
>
> -----Original Message-----
> From: Denny Erinjery [mailto:denny.erinjery@timelink.com]
> Sent: Thursday, September 10, 2009 3:04 PM
> To: Struts Users Mailing List
> Subject: excpetion chaining to custom exception handler issue
>
> HI,
> I'm using a global exception handler action class to get the exception
> details and display it on a custom error page.
> Following is the struts xml configuration
>        <global-results>
>                        <result name="Excpetion" type="chain">
>                                <param
> name="actionName">UnhandledExceptionHandler</param>
>                                <!-- param
> name="namespace">/namespaceWhereActionIsDefined</param -->
>                        </result>
>        </global-results>
>
>        <global-exception-mappings>
>            <exception-mapping exception=3D"java.lang.Exception"
> result="Excpetion"/>
>        </global-exception-mappings>
>
>
>        <action name="UnhandledExceptionHandler"
> class="com.timelink.falco.wui.struts.handlers.GlobalException">
>                    <result name=3D"error"
> type="dispatcher">/jsp/systemerror.jsp</result>
>
>        </action>
>
> Once my action class is invoked it will create my exception object using
> the current exception set by the struts setter as well as I get more
> details about the system at the time of the exception. In order to get
> the exception forwarded to my action class from the action where the
> exception occurs I use chaining in the result mapping
>        "<global-results>
>                        <result name="Excpetion" type="chain"> .... "
> This works and everything is populated on my error jsp page and the page
> gets displayed as expected. Now if I refresh this error page, although
> the actions go through the last exception path as expected, and my error
> handler class is executed, it will not display the error page again this
> time but will end up showing the following error=
>
> HTTP Status 500 - Infinite recursion detected: [//loginAction!login,
> //UnhandledExceptionHandler, //UnhandledExceptionHandler,
> //UnhandledExceptionHandler] - [unknown location]
> com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java
> :203)
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
> ionInvocation.java:361)
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
> cation.java:265)
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java
> :52)
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
> 68)
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:395)
>
> After this error if I refresh the above page(HTTP Status 500) , it will
> once again show my error page and a refresh on that page will bring back
> the error 500 again!!! This keeps on doing on consecutive refresh. This
> will go away if I use "redierctAction" in place of "chain" but then I
> will lost the information about the exception once it reached in my
> exception handling action class Please tell me is this a problem on my
> error handling or a sturts issue.
>
> Thanks
> Denny
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: excpetion chaining to custom exception handler issue

Posted by Denny Erinjery <de...@timelink.com>.
Anybody have any ides about this??
I try to do an additional action class with  redirectAction after the
first chaining using a second action to avoid the 500 error but that
didn't help me, debugging into the ActionChain interceptor from xworks
shows that it went to an infinte error  after checking the
chaininghistory
Thanks


-----Original Message-----
From: Denny Erinjery [mailto:denny.erinjery@timelink.com] 
Sent: Thursday, September 10, 2009 3:04 PM
To: Struts Users Mailing List
Subject: excpetion chaining to custom exception handler issue

HI,
I'm using a global exception handler action class to get the exception
details and display it on a custom error page.
Following is the struts xml configuration
        <global-results>
			<result name="Excpetion" type="chain">
				<param
name="actionName">UnhandledExceptionHandler</param>
				<!-- param
name="namespace">/namespaceWhereActionIsDefined</param -->
			</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception=3D"java.lang.Exception"
result="Excpetion"/>
        </global-exception-mappings>


	<action name="UnhandledExceptionHandler"
class="com.timelink.falco.wui.struts.handlers.GlobalException">
	            <result name=3D"error"
type="dispatcher">/jsp/systemerror.jsp</result>

	</action>

Once my action class is invoked it will create my exception object using
the current exception set by the struts setter as well as I get more
details about the system at the time of the exception. In order to get
the exception forwarded to my action class from the action where the
exception occurs I use chaining in the result mapping
        "<global-results>
			<result name="Excpetion" type="chain"> .... "
This works and everything is populated on my error jsp page and the page
gets displayed as expected. Now if I refresh this error page, although
the actions go through the last exception path as expected, and my error
handler class is executed, it will not display the error page again this
time but will end up showing the following error=

HTTP Status 500 - Infinite recursion detected: [//loginAction!login,
//UnhandledExceptionHandler, //UnhandledExceptionHandler,
//UnhandledExceptionHandler] - [unknown location]
com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java
:203)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
ionInvocation.java:361)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:265)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java
:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
68)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)

After this error if I refresh the above page(HTTP Status 500) , it will
once again show my error page and a refresh on that page will bring back
the error 500 again!!! This keeps on doing on consecutive refresh. This
will go away if I use "redierctAction" in place of "chain" but then I
will lost the information about the exception once it reached in my
exception handling action class Please tell me is this a problem on my
error handling or a sturts issue.

Thanks
Denny


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


excpetion chaining to custom exception handler issue

Posted by Denny Erinjery <de...@timelink.com>.
HI,
I'm using a global exception handler action class to get the exception
details and display it on a custom error page.
Following is the struts xml configuration
        <global-results>
			<result name="Excpetion" type="chain">
				<param
name="actionName">UnhandledExceptionHandler</param>
				<!-- param
name="namespace">/namespaceWhereActionIsDefined</param -->
			</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception=3D"java.lang.Exception"
result="Excpetion"/>
        </global-exception-mappings>


	<action name="UnhandledExceptionHandler"
class="com.timelink.falco.wui.struts.handlers.GlobalException">
	            <result name=3D"error"
type="dispatcher">/jsp/systemerror.jsp</result>

	</action>

Once my action class is invoked it will create my exception object using
the current exception set by the struts setter as well as I get more
details about the system at the time of the exception. In order to get
the exception forwarded to my action class from the action where the
exception occurs I use chaining in the result mapping
        "<global-results>
			<result name="Excpetion" type="chain"> .... "
This works and everything is populated on my error jsp page and the page
gets displayed as expected. Now if I refresh this error page, although
the actions go through the last exception path as expected, and my error
handler class is executed, it will not display the error page again this
time but will end up showing the following error=

HTTP Status 500 - Infinite recursion detected: [//loginAction!login,
//UnhandledExceptionHandler, //UnhandledExceptionHandler,
//UnhandledExceptionHandler] - [unknown location]
com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java
:203)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
ionInvocation.java:361)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:265)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java
:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4
68)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)

After this error if I refresh the above page(HTTP Status 500) , it will
once again show my error page and a refresh on that page will bring back
the error 500 again!!! This keeps on doing on consecutive refresh. This
will go away if I use "redierctAction" in place of "chain" but then I
will lost the information about the exception once it reached in my
exception handling action class Please tell me is this a problem on my
error handling or a sturts issue.

Thanks
Denny


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Chain a global result to an action?

Posted by Bill Bohnenberger <bi...@gmail.com>.
This works for me:

<struts>
    <package ...

        <global-results>
            <result name="error" type="redirect">DeadEnd</result>
        </global-results>

    ...
        <action name="DeadEnd" class="com.rp.db.actions.DeadEnd">
            <result>deadEnd.jsp</result>
        </action>

    ...
    </package>
</struts>

The entire action class is:

@SuppressWarnings("serial")
public class DeadEnd extends ActionSupport
{

}

and when any action returns "error" the deadEnd.jsp page is displayed.

- Bill

On Thu, Sep 10, 2009 at 11:49 AM, Jim Collings <jl...@gmail.com> wrote:

> Anybody know what the syntax for this is?  I don't seem to be getting it
> right.
>
>
> Jim C.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>