Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3769

<s:url> tag can not generate proper namespace when don't assign namespace value in tag.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1.2
    • 2.3.3
    • Plugin - Portlet
    • None

    Description

      I upgrade my application from 2.1.8 to 2.3.1.2, then find that <s:url> can't geneate proper result when I don't assign namespace value in the <s:url> tag. e.g, <s:url value="aaaa/">, in the old version, I got "http://xxx/xxxx&struts.portlet.action=/somenamespace/aaaa", but in the new version, I got "http://xxx/xxxx&struts.portlet.action=/aaaa", the namespace is missing.

      I check source code between 2.1.8 and 2.3.1.2, and find in org.apache.struts2.components.PortletUrlRenderer

      public void renderUrl(Writer writer, UrlProvider urlComponent) {
          ...
          urlComponent.setNamespace(urlComponent.determineNamespace(urlComponent.getNamespace(), urlComponent.getStack(),urlComponent.getHttpServletRequest()));  // Line 78, in 2.1.8
          ...
      }
      

      This statement is missing in 2.3.1.2, which cause struts can't find namespace by action name. I think it's losing feature.

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            yagumoreg@126.com Yagumo Pei
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: