You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Marco Rolando (JIRA)" <ji...@apache.org> on 2009/04/08 15:12:06 UTC

[jira] Created: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
------------------------------------------------------------------------------------

                 Key: WW-3077
                 URL: https://issues.apache.org/struts/browse/WW-3077
             Project: Struts 2
          Issue Type: Bug
          Components: Dispatch Filter
    Affects Versions: 2.1.6
         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
 
            Reporter: Marco Rolando


Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.

org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.

Below the filter configuration in web.xml

	<filter-mapping>
		<filter-name>rewriteUrl</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Christian Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46420#action_46420 ] 

Christian Martin commented on WW-3077:
--------------------------------------

Yes I did try to run with version 2.1.7-SNAPSHOT. That didn't work.
I had to implement the written code above with the version 2.1.7-snapshot to get it to work.
I've also looked at the other issue(WW-3000), but this isn't relevant since the app is using StrutsExecutionFilter  (not StrutsPrepareAndExecuteFilter).


> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-3077.
---------------------------------

    Resolution: Fixed

fixed in trunk. I used the "recursionCounter" that we keep in the request to detect a forward. thanks for reporting and the patch.

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher updated WW-3077:
--------------------------------

    Fix Version/s:     (was: Future)
                   2.1.8

since we have a patch, I'm setting to the next release

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46268#action_46268 ] 

Wes Wannemacher commented on WW-3077:
-------------------------------------

Marco, I don't use UrlRewrite, could you maybe prepare a patch and submit it? I don't know if any of the committers are actively using UrlRewrite, so without a patch, you aren't likely to see much action on this.

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: Future
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Christian Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46413#action_46413 ] 

Christian Martin edited comment on WW-3077 at 6/18/09 7:27 AM:
---------------------------------------------------------------

Comment deleted

      was (Author: cmartin):
    When is the release date for 2.1.8?
  
> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Christian Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46397#action_46397 ] 

Christian Martin commented on WW-3077:
--------------------------------------

I'm upgrading an application from webwork to struts 2.1.6. My problem is that I cannot upgrade since it doesn't support UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) filter. Are there any other filters which can rewrite the url?

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: Future
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46416#action_46416 ] 

Musachy Barroso commented on WW-3077:
-------------------------------------

see https://issues.apache.org/struts/browse/WW-3000

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46415#action_46415 ] 

Musachy Barroso commented on WW-3077:
-------------------------------------

Did you try 2.1.7? I am almost sure I fixed this already

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Christian Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46413#action_46413 ] 

Christian Martin edited comment on WW-3077 at 6/18/09 7:27 AM:
---------------------------------------------------------------

.

      was (Author: cmartin):
    Comment deleted
  
> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Alex Siman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46412#action_46412 ] 

Alex Siman edited comment on WW-3077 at 6/18/09 7:23 AM:
---------------------------------------------------------

@Christian Martin
See my prev comment: Struts 2.1.6 + UrlRewriteFilter work well for me using the patch.
There is no need to look for any other URL rewriter since it's Struts issue.

      was (Author: namisandr):
    @Christian Martin
  
> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Alex Siman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46270#action_46270 ] 

Alex Siman commented on WW-3077:
--------------------------------

Hi.

I have solved this issue for me. Simply I copied StrutsExecuteFilter and made little modifications to it. Maybe it has potential bugs, but it seems like working well.

Such as I did not check out Struts from SVN, I paste my StrutsExecuteFilter here. Hope somebody will made patch from it.

web.xml
--------------------------------------------------
...
	<filter>
		<filter-name>UrlRewriteFilter</filter-name>
		<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
	<filter>
	<filter>
		<filter-name>struts-prepare</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
	</filter>
	<filter>
		<filter-name>sitemesh</filter-name>
		<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
	</filter>
	<filter>
		<filter-name>struts-execute</filter-name>
		<filter-class>custom.StrutsExecuteFilter</filter-class>
	</filter>
...
	<filter-mapping>
		<filter-name>UrlRewriteFilter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>struts-prepare</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>sitemesh</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>struts-execute</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
...

custom.StrutsExecuteFilter.java
--------------------------------------------------
package custom;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
import org.apache.struts2.dispatcher.ng.InitOperations;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import org.apache.struts2.dispatcher.ng.filter.FilterHostConfig;
import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter;

/**
 * Executes the discovered request information.  This filter requires the {@link StrutsPrepareFilter} to have already
 * been executed in the current chain.
 */
public class StrutsExecuteFilter implements StrutsStatics, Filter {

	public static final String EXECUTING_ACTION = "struts.filter.executingAction";

    private PrepareOperations prepare;
    private ExecuteOperations execute;

    private FilterConfig filterConfig;

    public void init(FilterConfig filterConfig) throws ServletException {
        this.filterConfig = filterConfig;
    }

    protected synchronized void lazyInit() {
        if (execute == null) {
            InitOperations init = new InitOperations();
            Dispatcher dispatcher = init.findDispatcherOnThread();
            init.initStaticContentLoader(new FilterHostConfig(filterConfig), dispatcher);

            prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
            execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
        }

    }

    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {

        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;

		if (excludeUrl(request)) {
			chain.doFilter(request, response);
			return;
		}

        // This is necessary since we need the dispatcher instance, which was created by the prepare filter
		if (execute == null) {
			lazyInit();
		}

		ActionMapping mapping = null;
		Object execAttr = req.getAttribute(EXECUTING_ACTION);
		if (execAttr == null) {
			mapping = prepare.findActionMapping(request, response);
		}

        if (mapping == null) {
            boolean handled = execute.executeStaticResourceRequest(request, response);
            if (!handled) {
                chain.doFilter(request, response);
            }
        } else {
        	request.setAttribute(EXECUTING_ACTION, true);
            execute.executeAction(request, response, mapping);
            request.removeAttribute(EXECUTING_ACTION);
        }
    }

	private boolean excludeUrl(HttpServletRequest request) {
		return request.getAttribute(StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING) != null;
	}

    public void destroy() {
        prepare = null;
        execute = null;
        filterConfig = null;
    }
}


> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: Future
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Christian Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46413#action_46413 ] 

Christian Martin commented on WW-3077:
--------------------------------------

When is the release date for 2.1.8?

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher updated WW-3077:
--------------------------------

    Attachment: StrutsExecuteFilter.java.patch

Here it is as a patch. I haven't worked on the filter dispatcher, so I'm going to leave the patch out here for someone else more adventurous

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: Future
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher updated WW-3077:
--------------------------------

    Fix Version/s: Future

setting to future, pending a patch 

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: Future
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3077) StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD

Posted by "Alex Siman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46412#action_46412 ] 

Alex Siman commented on WW-3077:
--------------------------------

@Christian Martin

> StrutsPrepareAndExecuteFilter: infinite loop in filter chain with dispatcher FORWARD
> ------------------------------------------------------------------------------------
>
>                 Key: WW-3077
>                 URL: https://issues.apache.org/struts/browse/WW-3077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Windows XP SP2, Java 1.6.0_10. Tomcat 6.0.18
>  
>            Reporter: Marco Rolando
>             Fix For: 2.1.8
>
>         Attachments: StrutsExecuteFilter.java.patch
>
>
> Using the struts 2 filter StrutsPrepareAndExecuteFilter with UrlRewrite (org.tuckey.web.filters.urlrewrite.UrlRewriteFilter) the filter evaluation sequence enters an infinite loop. The same problem arise with other forwarding filters.
> org.apache.struts2.dispatcher.FilterDispatcher does not suffer from this problem.
> Below the filter configuration in web.xml
> 	<filter-mapping>
> 		<filter-name>rewriteUrl</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>
> 	<filter-mapping>
> 		<filter-name>struts2</filter-name>
> 		<url-pattern>/*</url-pattern>
> 		<dispatcher>REQUEST</dispatcher>
> 		<dispatcher>FORWARD</dispatcher>
> 	</filter-mapping>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.