[ 
https://issues.apache.org/jira/browse/WW-5416?focusedWorklogId=1031917&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031917
 ]

ASF GitHub Bot logged work on WW-5416:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Jul/26 18:52
            Start Date: 23/Jul/26 18:52
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart opened a new pull request, #541:
URL: https://github.com/apache/struts-examples/pull/541

   ## Summary
   
   Fixes [WW-5416](https://issues.apache.org/jira/browse/WW-5416): the 
**helloworld** example returns a 404 when following the documented instructions 
(`http://localhost:8080/helloworld/index.action`).
   
   The root cause is a `struts.action.extension` override that *removes* the 
`.action` extension from the allowed set. The framework default is `action,,` 
(accepts both `.action` and extensionless URLs); overriding it to `,` (or `""`) 
drops `.action`, so the documented URLs 404. In-app navigation uses Struts 
URL/form tags that respect the configured extension, which is why the bug is 
invisible until a user types the documented `.action` URL directly.
   
   The fix deletes the one overriding `<constant>` line, restoring the default. 
This is strictly additive — extensionless URLs keep working, and `.action` URLs 
now resolve.
   
   ## Changes
   
   Removed the `struts.action.extension` override in three modules that shared 
this latent bug:
   
   - `helloworld/src/main/resources/struts.xml` — was `,` (the reported ticket)
   - `text-provider/src/main/resources/struts.xml` — was `,`
   - `sitemesh3/src/main/resources/struts.xml` — was `""` (unmapped `.action` 
requests silently fell through to the index action via `default-action-ref`)
   
   **Intentionally left untouched:** `rest-angular` (`,,xml,json,action`) and 
`mailreader2` (`do`) — those overrides are part of what each example 
demonstrates.
   
   ## Verification
   
   - Full reactor `./mvnw clean package` (with tests) → BUILD SUCCESS.
   - Each of the three modules verified via `mvn jetty:run` + curl: `.action` 
URLs return 200 post-fix, and extensionless URLs still return 200. For 
sitemesh3, confirmed `hello.action` now routes to `HelloAction` (not the index 
fallback) with SiteMesh decoration intact.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1031917)
    Remaining Estimate: 0h
            Time Spent: 10m

> Hello World example does not match documentation and returns a 404
> ------------------------------------------------------------------
>
>                 Key: WW-5416
>                 URL: https://issues.apache.org/jira/browse/WW-5416
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Example Applications
>    Affects Versions: examples-1.1
>         Environment: Recreated on the following OS's
>  * Windows 11 Home Version 23H2 OS Build 22631.3447
>  * WSL 2 on an Ubuntu 20.04.6 LTS (focal)
>            Reporter: Tim Mousaw
>            Priority: Major
>             Fix For: 7.3.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Using the [struts-examples|https://github.com/tmousaw/struts-examples], 
> navigate to the helloworld example and execute {{{}mvn jetty:run{}}}. 
> Navigate to the URL [http://localhost:8080/helloworld/index.action] and you 
> will get:
> h2. HTTP ERROR 404 Not Found
> ||URI:|/helloworld/index.action|
> ||STATUS:|404|
> ||MESSAGE:|Not Found|
> ||SERVLET:|default|
> ----
> [Powered by Jetty:// 9.4.46.v20220331|https://eclipse.org/jetty]
> This appears to be due to {{struts.action.extension}} constant value in 
> {{{}struts.xml{}}}. Removing this and falling back to the default value in 
> [https://github.com/apache/struts/blob/master/core/src/main/resources/org/apache/struts2/default.properties#L87]
>  allows the example to succeed.



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

Reply via email to