Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.5, 2.5.1
    • Fix Version/s: 2.5.2
    • Component/s: None
    • Labels:
      None

      Description

      I do stumble over a new behaviour in Struts 2.5.

      Working with:

      <action name="*">
        <result type="redirect">
          <param name="location">/home</param>
          <param name="namespace">/</param>
        </result>
      </action>
      

      To catch/redirect unknown request to the home page, the following requests will not be processed:

      https://localhost:8443/myApp/static/whatever

      The path /static/ seems to trigger a "special" behaviour since Struts 2.5?

      There is also an inconsistency between:

      https://localhost:8443/myApp/whatever/ (correct 404)
      https://localhost:8443/myApp/static/ (empty white page)

      Why is the path /static/ treated differently, and where is the exact class responsible for this?

      Thanks for considering.

      Markus

        Activity

        Show
        lukaszlenart Lukasz Lenart added a comment - Markus Fischer you can always exclude specific URLs https://cwiki.apache.org/confluence/display/WW/web.xml#web.xml-ExcludespecificURLs
        Hide
        flyingfischer Markus Fischer added a comment -

        Thanks!

        Show
        flyingfischer Markus Fischer added a comment - Thanks!
        Hide
        flyingfischer Markus Fischer added a comment -

        Thanks! You are perfectly right:

        I did temporarily revert https://git-wip-us.apache.org/repos/asf?p=struts.git;h=5e31097 to see, if this helps. And yes, that's it.

        But it's even more simple (from your link to http://struts.apache.org/docs/static-content.html):

        One can let StrutsPrepareAndExecuteFilter.java untouched and use <constant name="struts.serve.static" value="false" /> in struts.xml, which will restore the previous behaviour.

        Show
        flyingfischer Markus Fischer added a comment - Thanks! You are perfectly right: I did temporarily revert https://git-wip-us.apache.org/repos/asf?p=struts.git;h=5e31097 to see, if this helps. And yes, that's it. But it's even more simple (from your link to http://struts.apache.org/docs/static-content.html): One can let StrutsPrepareAndExecuteFilter.java untouched and use <constant name="struts.serve.static" value="false" /> in struts.xml, which will restore the previous behaviour.
        Hide
        aleksandr-m Aleksandr Mashchenko added a comment -

        The /static/ is/was different way before 2.5 - see Static Content.

        Since 2.5 static resources are loaded first - https://issues.apache.org/jira/browse/WW-4621, that is why your setup acts differently after version upgrade.

        To redirect unknown request to the home page consider using default action and Unknown Handlers.

        Show
        aleksandr-m Aleksandr Mashchenko added a comment - The /static/ is/was different way before 2.5 - see Static Content . Since 2.5 static resources are loaded first - https://issues.apache.org/jira/browse/WW-4621 , that is why your setup acts differently after version upgrade. To redirect unknown request to the home page consider using default action and Unknown Handlers .

          People

          • Assignee:
            Unassigned
            Reporter:
            flyingfischer Markus Fischer
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development