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

Streamlined link tag for single-parameter links

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 2.0.1
    • None
    • Plugin - Tags
    • None

    Description

      The url and param tags are very flexibile, but the most common case of a single parameter link.

      <s:url id="url" action="HelloWorld" includeContext="false">
      <s:param name="request_locale">en</s:param>
      </s:url>
      <s:a href="%

      {url}

      ">English</s:a>

      is verbose (to the point of being silly).

      It is worthwhile to have a streamlined link tag, a al Struts 1, to cover the single-parameter case.

      <s:link action="HelloWorld" param="request_locale" paramValue="en">English</s:link>

      In the interest of brevity, I would suggest that includeContext default to "false" for the single-parameter case.

      Or, with a message resource key, from

      <a href="<s:url action="Login_input"/>">%

      {getText('"sign_on"')}

      </a>

      to

      <s:link action="login_input" key="sign_on" />

      Attachments

        Issue Links

          Activity

            People

              germuska Joseph Lad Germuska
              husted Ted Husted
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: