Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WW-5190] Fixes StackOverflowException when dispatching request #571

Merged
merged 12 commits into from
Jul 11, 2022

Conversation

lukaszlenart
Copy link
Member

@lukaszlenart lukaszlenart commented Jun 15, 2022

This PR addresses a problem with forwarding to another JSP or action, but only in case if StrutsExecuteAndPrepareFilter is used - when combination of StrutsPrepareFilter & StrutsExecuteFilter is used; forwarding to actions won't work - it's a large problem and will be addressed separately, this never worked tbh.

Fixes WW-5190

@coveralls
Copy link

coveralls commented Jun 15, 2022

Coverage Status

Coverage increased (+0.03%) to 50.658% when pulling cb59974 on WW-5190-match-action-proxy into 64d0542 on master.

@yasserzamani
Copy link
Member

Is it simple to have a testWW5190 test method which tests that this issue is fixed? Sorry I couldn't understand the root cause to write a test. My best guess is that it's because of Struts FORWARD happens in same thread, is it?

@lukaszlenart
Copy link
Member Author

lukaszlenart commented Jun 17, 2022

Is it simple to have a testWW5190 test method which tests that this issue is fixed? Sorry I couldn't understand the root cause to write a test. My best guess is that it's because of Struts FORWARD happens in same thread, is it?

The simplest way is to define a dispatcher example in Showcase app and define an integration test for that.

@lukaszlenart
Copy link
Member Author

There is some discrepancy between StrutsPrepareAndExcuteFilter and StrutsPrepareFilter & StrutsExcuteFilter which I'm trying to figure out

@yasserzamani
Copy link
Member

There is some discrepancy between StrutsPrepareAndExcuteFilter and StrutsPrepareFilter & StrutsExcuteFilter which I'm trying to figure out

Maybe we can merge and postpone this to another release? just to make sure that the release has minimal required changes to fix regressions.

BTW how much time we do have do you know please? I like to find some free cycles and add an integration test to showcase app as you suggested , thanks!

@lukaszlenart
Copy link
Member Author

I have integration test but it won't work with the Showcase App because of those problems.

@yasserzamani
Copy link
Member

So it makes sense to have those in this PR please. awesome!! thank you very much!

@lukaszlenart
Copy link
Member Author

@yasserzamani I extend description of the PR as the problem is a bit more complicated. My fix addresses only the broken support for forwarding to an another action when using StrutsPrepareAndExecuteFilter, yet the Showcase App is using combination of StrutsPrepareFilter/StrutsExecuteFilter and this never worked properly - I created a dedicated ticket to fix this with the next Minor release.

@lukaszlenart lukaszlenart requested a review from yasserzamani July 8, 2022 10:54
@lukaszlenart lukaszlenart merged commit f3cb892 into master Jul 11, 2022
@lukaszlenart lukaszlenart deleted the WW-5190-match-action-proxy branch July 11, 2022 08:25
@burtonrhodes
Copy link
Contributor

burtonrhodes commented Oct 10, 2022

This change is breaking my ExecuteAndWait implementations using the recommended refresh implementation. The resulting url appends the file with "!methodName" making the url invalid.

A real world example is below:

<action name="LetterMergeBulk_contactList" class="com.afs.web.struts.action.letters.LetterMergeBulkAction" method="contactList">
    <interceptor-ref name="executeAndWaitInterceptor" />
    <result name="wait">/struts/letters/letterMergeBulkWait_popup.jsp</result>
    <result>/struts/letters/letterMerge_popup.jsp</result>
</action>

Results in (v6.0.3)

/afs/app/LetterMergeBulk_contactList!contactList.action?struts.token.name=token&token=A9SIKBABK17IZFM6AHSP0QSFIJHLZKJB&letterTemplateId=14773

Instead of (v6.0.0)

/afs/app/LetterMergeBulk_contactList.action?struts.token.name=token&token=A9SIKBABK17IZFM6AHSP0QSFIJHLZKJB&letterTemplateId=14773

Using HTML Header

<head>
   <title>Please wait</title>
   <meta http-equiv="refresh" content="5;url=<s:url includeParams="all" />"/>
</head>

@lukaszlenart
Copy link
Member Author

@burtonrhodes do you use DMI?

@burtonrhodes
Copy link
Contributor

I don't use DMI, but have no specific setting in my struts.xml file regarding it. However, given your suggestion, I specifically disabled DMI to see if that would help - but the result is still the same.

<constant name="struts.enable.DynamicMethodInvocation" value="false"/>

@lukaszlenart
Copy link
Member Author

Ok, so please register a new JIRA ticket and we can start working on solution after figuring out what's wrong.

@burtonrhodes
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants