[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-09-01 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878457#comment-17878457
 ] 

Rubens Gomes commented on WW-5450:
--

Hi Lukasz,

I verified that Spring Boot packaging needs to be "war" to support JSP.  I
pushed a fix to the demo strutsapp main branch "
https://github.com/rubensgomes/strutsapp";.

I am sorry about reporting a false bug.

Rubens

On Sun, Sep 1, 2024 at 3:58 PM Rubens Gomes 



> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Assignee: Lukasz Lenart
>Priority: Major
> Fix For: 7.0.0
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-09-01 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878451#comment-17878451
 ] 

Rubens Gomes commented on WW-5450:
--

Hi Lukasz! I think you are right. I am using jar packaging in the new
webapp, and it appears Spring may not support JSP under jar packaging.  My
old spring-struts webapp was built from maven as a war packaging and that's
why that was working.  I will change my build to use war packaging and test
it later today or tomorrow.

Spring Boot JSP - War Packaging





On Sat, Aug 31, 2024 at 12:42 AM Lukasz Lenart (Jira) 



> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Assignee: Lukasz Lenart
>Priority: Major
> Fix For: 7.0.0
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-10 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17872641#comment-17872641
 ] 

Rubens Gomes commented on WW-5450:
--

H Lukasz,

I created a simple spring-struts-jsp webapp using the versions reported in thie 
Jira, and I continue to see the GET /WEB-INF/content/index.jsp.

I made the app public in the following repo:

[https://github.com/rubensgomes/strutsapp]
 # git clone it
 # run "./gradlew --info bootRun"
 # go to browser and enter "http://localhost:8080/";
 # you will see the stack trace and error below:

{code:java}

Whitelabel Error PageThis application has no explicit mapping for /error, so 
you are seeing this as a fallback.Sat Aug 10 19:37:03 CDT 2024There was an 
unexpected error (type=Not Found, status=404).No endpoint GET 
/WEB-INF/content/index.jsp.org.springframework.web.servlet.NoHandlerFoundException:
 No endpoint GET /WEB-INF/content/index.jsp.
at 
org.springframework.web.servlet.DispatcherServlet.noHandlerFound(DispatcherServlet.java:1304)
at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
at 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:110)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:632)
at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:408)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:330)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:267)
at 
org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:168)
at 
org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:206)
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:377)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:284)
at 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:260)
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeConditional(DefaultActionInvocation.java:299)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:179)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeConditional(DefaultActionInvocation.java:299)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeConditional(DefaultActionInvocation.java:299)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at 
org.apache.struts2.interceptor.FetchMetadataInterceptor.intercept(FetchMetadataInterceptor.java:78)
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeConditional(DefaultActionInvocation.java:299)
at 
com.opensy

[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-07 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871665#comment-17871665
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 2:19 PM:
--

I changed the %{#request to %{#attr and I am having other problems with spring 
security.  I need more time to see what is going on, and probably would not be 
able to test this until the weekend. 

In the meantime, have you tried to write a simple action to dispatch to a jsp 
and see if you get a FORWARD?  I am thinking of writing a very simple webapp 
with an action redenring a jsP and see what happens.  I don't have time right 
now.

 


was (Author: JIRAUSER305904):
I changed the %{#request to %{#attr and I am having other problems with spring 
security.  I need more time to see what is going on, and probably would not be 
able to test this until the weekend. 

In the meantime, have you tried to write a simple action to dispatch to a jsp 
and see if you get a FORWARD?  I am thinking of writing a very simple webapp 
with an action redenring a jsP and see what happens.  I don't have time right 
now due to my full-time work.

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Assignee: Lukasz Lenart
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-07 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871665#comment-17871665
 ] 

Rubens Gomes commented on WW-5450:
--

I changed the %{#request to %{#attr and I am having other problems with spring 
security.  I need more time to see what is going on, and probably would not be 
able to test this until the weekend. 

In the meantime, have you tried to write a simple action to dispatch to a jsp 
and see if you get a FORWARD?  I am thinking of writing a very simple webapp 
with an action redenring a jsP and see what happens.  I don't have time right 
now due to my full-time work.

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Assignee: Lukasz Lenart
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871492#comment-17871492
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:46 AM:
---

1) I have 3 (three) different types of JSP folders in webapp/WEB-INF/content:
 * desktop
 * smartphone
 * feature (used for old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named ""%\{#request.device}" which is 
what you see in the @Result annotation block.  See piece of code from 
interceptor below:
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
{code}


was (Author: JIRAUSER305904):
1) I have 3 (three) different types of JSP folders in webapp/WEB-INF/content:
 * desktop
 * smartphone
 * feature (used for old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named ""%\{#request.device}" which is 
what you see in the @Result annotation block.  See piece of code from 
interceptor below:


 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871498#comment-17871498
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:46 AM:
---

I can try your suggestion of using %\{#attr.device}, but wondering why is that 
going to help?  I ask because resolving the path to JSP is not a problem.  In 
fact, this code using %\{#request.device} works in Struts 6.6.0 as said before. 
 My problem happens in Struts 7.x with Tomcat using GET instead of FORWARD to 
render the JSP file.  


was (Author: JIRAUSER305904):
I can try your suggestion of using %\{#attr.device}, but wondering why is that 
going to help?  I ask because resolving the path to JSP is not a problem.  In 
fact, this code using %\{#request.device} works in Struts 6.6.0 as said before. 
 My problem is Tomcat using GET instead of FORWARD to render the JSP file.  Not 
sure why it would work in 6.6.0 and not in 7.0.0?

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871498#comment-17871498
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:45 AM:
---

I can try your suggestion of using %\{#attr.device}, but wondering why is that 
going to help?  I ask because resolving the path to JSP is not a problem.  In 
fact, this code using %\{#request.device} works in Struts 6.6.0 as said before. 
 My problem is Tomcat using GET instead of FORWARD to render the JSP file.  Not 
sure why it would work in 6.6.0 and not in 7.0.0?


was (Author: JIRAUSER305904):
I can try your suggestion of using %\{attr.device}, but wondering why is that 
going to help?  I ask because resolving the path to JSP is not a problem.  In 
fact, this code using %\{request.device} works in Struts 6.6.0 as said before.  
My problem is Tomcat using GET instead of FORWARD to render the JSP file.  Not 
sure why it would work in 6.6.0 and not in 7.0.0?

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871498#comment-17871498
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:44 AM:
---

I can try your suggestion of using %\{attr.device}, but wondering why is that 
going to help?  I ask because resolving the path to JSP is not a problem.  In 
fact, this code using %\{request.device} works in Struts 6.6.0 as said before.  
My problem is Tomcat using GET instead of FORWARD to render the JSP file.  Not 
sure why it would work in 6.6.0 and not in 7.0.0?


was (Author: JIRAUSER305904):
I can try your suggestion, but wondering why is that going to help?  I ask 
because resolving the path to JSP is not a problem.  In fact, this code using 
%\{request.device} works in Struts 6.6.0 as said before.  My problem is Tomcat 
using GET instead of FORWARD to render the JSP file.  Not sure why it would 
work in 6.6.0 and not in 7.0.0?

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871498#comment-17871498
 ] 

Rubens Gomes commented on WW-5450:
--

I can try your suggestion, but wondering why is that going to help?  I ask 
because resolving the path to JSP is not a problem.  In fact, this code using 
%\{request.device} works in Struts 6.6.0 as said before.  My problem is Tomcat 
using GET instead of FORWARD to render the JSP file.  Not sure why it would 
work in 6.6.0 and not in 7.0.0?

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871492#comment-17871492
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:40 AM:
---

1) I have 3 (three) different types of JSP folders in webapp/WEB-INF/content:
 * desktop
 * smartphone
 * feature (used for old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named ""%\{#request.device}" which is 
what you see in the @Result annotation block.  See piece of code from 
interceptor below:


 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 


was (Author: JIRAUSER305904):
1) I have 3 (three) different JSP folders in webapp/WEB-INF/content:
 * desktop
 * smartphone
 * feature (used for old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

 

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named "%\{#attr.device}".  See code 
below:

 
 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871494#comment-17871494
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:36 AM:
---

As for the security concerns, I am using SpringSecurity to enfoce that any JSP 
should only be retrieved using internal FORWARD messages: meaning that whoever 
trigger the rendering of the JSP should be my own code internally thru the use 
of that type="dispatcher" in the @Result annotation.

Notice that in Struts 6 it works fine with that @Result type = "dispatcher" 
inside the @Result annotation block.

I only started having the reported issue with GET being used with the version 
7.x


was (Author: JIRAUSER305904):
As for the security concerns, I am using SpringSecurity to enfoce that any JSP 
should only be retrieved using internal FORWARD messages: meaning that whoever 
trigger the rendering of the JSP should be my own code internally thru the use 
of that dispatcher.

 

Notice that in Struts 6 it works fine with that @Result type = "dispatcher" 
inside the @Result annotation block.

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871494#comment-17871494
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:35 AM:
---

As for the security concerns, I am using SpringSecurity to enfoce that any JSP 
should only be retrieved using internal FORWARD messages: meaning that whoever 
trigger the rendering of the JSP should be my own code internally thru the use 
of that dispatcher.

 

Notice that in Struts 6 it works fine with that @Result type = "dispatcher" 
inside the @Result annotation block.


was (Author: JIRAUSER305904):
responded in the Jira comments.



> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871494#comment-17871494
 ] 

Rubens Gomes commented on WW-5450:
--

responded in the Jira comments.



> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871492#comment-17871492
 ] 

Rubens Gomes edited comment on WW-5450 at 8/7/24 12:28 AM:
---

1) I have 3 (three) different JSP folders in webapp/WEB-INF/content:
 * desktop
 * smartphone
 * feature (used for old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

 

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named "%\{#attr.device}".  See code 
below:

 
 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 


was (Author: JIRAUSER305904):
1) I have 3 (three) different JSP folders in webapp/WEB-INF:
 * desktop
 * smartphone (for smartphones and tables)
 * feature (this was used for the old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

 

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named "%\{#attr.device}".  See code 
below:

 
 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-08-06 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871492#comment-17871492
 ] 

Rubens Gomes commented on WW-5450:
--

1) I have 3 (three) different JSP folders in webapp/WEB-INF:
 * desktop
 * smartphone (for smartphones and tables)
 * feature (this was used for the old basic cell phones) : no longer supported

2) I have configured a Struts Interceptor in the request pipeline. I believe 
this interceptor runs before the Action is invoked. 

 

3) This interceptor looks at session to see if a device has been detected 
previously.  If not it uses a DeviceDetector that parses HTTP headers looking 
for any clues which might help decipher one of the device types above.  If none 
is found, it defaults to smartphone.

 

4) The interceptor in 3) then updates session if not up-to-date and makes the 
following call, whre DEVICE_SELECTED_KEY is "device".  And since the attribute 
is being set on the request object it is named "%\{#attr.device}".  See code 
below:

 
 
{code:java}
request.setAttribute(DEVICE_SELECTED_KEY, 
userSession.getSelectedDevice().getType());
 
{code}
 

 

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
> Fix For: 7.0.0
>
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> —
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-07-28 Thread Rubens Gomes (Jira)


 [ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rubens Gomes updated WW-5450:
-
Description: 
I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring Security 
with embedded tomcat version is "10.1.26"

 

Environment:

Struts 2 "7.0.0-M9"

Spring Boot "3.3.2"

Tomcat "10.1.26"

Java 21

 

I have a Struts Action class annotated with :
{code:java}
@Result( 
  name = Action.INPUT,
  location = "/WEB-INF/content/%{#request.device}/login.jsp",
  type = "dispatcher"
){code}
 I have noticed that after returning from the Action class 
(ViewLoginAction.java) the framework is invoking the above JSP using a 
DispatcherType.GET instead of DisplatcherType.FORWARD.

StrutsRequestWrapper is missing request attribute 
"jakarta.servlet.forward.request_uri"

Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward method 
fails to find that attribute in the following line:
{code:java}
if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
{ 
  ...
  ...
  // then tomcat defaults to setting value of various request attributes 
  ...
  ...
}
 
{code}
 

And after that, tomcat calls "processRequest(request, response, state);" in the 
same instance "ApplicationDispatcher" and fails to resolve a FORWARD dispatcher 
type below.

 

Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type it 
does a GET on the JSP, instead of FORWARD.

 

Should StrutsRequestWrapper have request attribute 
"jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
instead of FORWARD? 

 

I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded Tomcat 
"9.0.83". which is based on javax.servlet instead.

 

—

Rubens Gomes

 

  was:
I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring Security 
with embedded tomcat version is "10.1.26"

I have a Struts Action class annotated with :

 
{code:java}
@Result( 
  name = Action.INPUT,
  location = "/WEB-INF/content/%{#request.device}/login.jsp",
  type = "dispatcher"
){code}
 
I have noticed that after returning from the Action class 
(ViewLoginAction.java) the framework is invoking the above JSP using a 
DispatcherType.GET instead of DisplatcherType.FORWARD.

 

StrutsRequestWrapper is missing request attribute 
"jakarta.servlet.forward.request_uri"

 

Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward method 
fails to find that attribute in the following line:

 

 
{code:java}
if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
{ 
  ...
  ...
  // then tomcat defaults to setting value of various request attributes 
  ...
  ...
}
 
{code}
 

And after that, tomcat calls "processRequest(request, response, state);" in the 
same instance "ApplicationDispatcher" and fails to resolve a FORWARD dispatcher 
type below.

 

Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type it 
does a GET on the JSP, instead of FORWARD.

 

Should StrutsRequestWrapper have request attribute 
"jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
instead of FORWARD? 

 

I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded Tomcat 
"9.0.83". which is based on javax.servlet instead.

 

---

Rubens Gomes

 


> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
>  
> Environment:
> Struts 2 "7.0.0-M9"
> Spring Boot "3.3.2"
> Tomcat "10.1.26"
> Java 21
>  
> I have a Struts Action class annotated with :
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, 

[jira] [Commented] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-07-28 Thread Rubens Gomes (Jira)


[ 
https://issues.apache.org/jira/browse/WW-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869210#comment-17869210
 ] 

Rubens Gomes commented on WW-5450:
--

More details reported in the Struts-User Mailing List link below entitled:

"Struts ServletDispatcherResult Forwarding GET Instead of FORWARD"

posted on  Monday, July 22, 2024 10:23:51 AM CDT

 

[https://lists.apache.org/thread/dbgqnl76gqv36hv4hmosn9xm9hy43xx8]

 

> ServletDispatcherResult Forwarding GET Instead of FORWARD
> -
>
> Key: WW-5450
> URL: https://issues.apache.org/jira/browse/WW-5450
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 7.0.0
>Reporter: Rubens Gomes
>Priority: Major
>
> I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring 
> Security with embedded tomcat version is "10.1.26"
> I have a Struts Action class annotated with :
>  
> {code:java}
> @Result( 
>   name = Action.INPUT,
>   location = "/WEB-INF/content/%{#request.device}/login.jsp",
>   type = "dispatcher"
> ){code}
>  
> I have noticed that after returning from the Action class 
> (ViewLoginAction.java) the framework is invoking the above JSP using a 
> DispatcherType.GET instead of DisplatcherType.FORWARD.
>  
> StrutsRequestWrapper is missing request attribute 
> "jakarta.servlet.forward.request_uri"
>  
> Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward 
> method fails to find that attribute in the following line:
>  
>  
> {code:java}
> if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
> { 
>   ...
>   ...
>   // then tomcat defaults to setting value of various request attributes 
>   ...
>   ...
> }
>  
> {code}
>  
> And after that, tomcat calls "processRequest(request, response, state);" in 
> the same instance "ApplicationDispatcher" and fails to resolve a FORWARD 
> dispatcher type below.
>  
> Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type 
> it does a GET on the JSP, instead of FORWARD.
>  
> Should StrutsRequestWrapper have request attribute 
> "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
> instead of FORWARD? 
>  
> I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded 
> Tomcat "9.0.83". which is based on javax.servlet instead.
>  
> ---
> Rubens Gomes
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (WW-5450) ServletDispatcherResult Forwarding GET Instead of FORWARD

2024-07-28 Thread Rubens Gomes (Jira)
Rubens Gomes created WW-5450:


 Summary: ServletDispatcherResult Forwarding GET Instead of FORWARD
 Key: WW-5450
 URL: https://issues.apache.org/jira/browse/WW-5450
 Project: Struts 2
  Issue Type: Bug
  Components: Core
Affects Versions: 7.0.0
Reporter: Rubens Gomes


I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring Security 
with embedded tomcat version is "10.1.26"

I have a Struts Action class annotated with :

 
{code:java}
@Result( 
  name = Action.INPUT,
  location = "/WEB-INF/content/%{#request.device}/login.jsp",
  type = "dispatcher"
){code}
 
I have noticed that after returning from the Action class 
(ViewLoginAction.java) the framework is invoking the above JSP using a 
DispatcherType.GET instead of DisplatcherType.FORWARD.

 

StrutsRequestWrapper is missing request attribute 
"jakarta.servlet.forward.request_uri"

 

Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward method 
fails to find that attribute in the following line:

 

 
{code:java}
if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
{ 
  ...
  ...
  // then tomcat defaults to setting value of various request attributes 
  ...
  ...
}
 
{code}
 

And after that, tomcat calls "processRequest(request, response, state);" in the 
same instance "ApplicationDispatcher" and fails to resolve a FORWARD dispatcher 
type below.

 

Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type it 
does a GET on the JSP, instead of FORWARD.

 

Should StrutsRequestWrapper have request attribute 
"jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET 
instead of FORWARD? 

 

I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded Tomcat 
"9.0.83". which is based on javax.servlet instead.

 

---

Rubens Gomes

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (WW-5430) Struts 7.0.0-M6 - Runtime Error freemarker.cache.WebappTemplateLoader

2024-06-20 Thread Rubens Gomes (Jira)
Rubens Gomes created WW-5430:


 Summary: Struts 7.0.0-M6 - Runtime Error 
freemarker.cache.WebappTemplateLoader
 Key: WW-5430
 URL: https://issues.apache.org/jira/browse/WW-5430
 Project: Struts 2
  Issue Type: Bug
  Components: Core
Affects Versions: 7.0.0
Reporter: Rubens Gomes


Getting runtime error below with 7.0.0-M6.  It appears that method
 "org.apache.struts2.views.freemarker.FreemarkerManager.createTemplateLoader"

is using "freemarker.cache.WebappTemplateLoader" which is based on legacy 
"javax.servlet"?

"Note that this is for the legacy "javax" Servlet API; for Jakarta (that 
is, in modern Servlet containers), use 
freemarker.ext.jakarta.servlet.WebappTemplateLoader instead (since 2.3.33). ..."

java.lang.NoSuchMethodError: 'void 
freemarker.cache.WebappTemplateLoader.(jakarta.servlet.ServletContext)'
    at 
org.apache.struts2.views.freemarker.FreemarkerManager.createTemplateLoader(FreemarkerManager.java:468)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.struts2.views.freemarker.FreemarkerManager.init(FreemarkerManager.java:293)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(FreemarkerManager.java:265)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler.init(DefaultDispatcherErrorHandler.java:66)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:632) 
~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:48)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:60)
 ~[struts2-core-7.0.0-M6.jar:7.0.0-M6]
    at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:245)
 ~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:102)
 ~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3846) 
~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4450)
 ~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) 
~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203) 
~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193) 
~[tomcat-embed-core-10.1.24.jar:10.1.24]
    at 
java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) 
~[na:na]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)