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

unable to concatenate strings in the value attribute of the set tag

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.11
    • None
    • Expression Language
    • None
    • Tested on Debian Linux testing with Tomcat 6.0.14 and JBoss 4.

    Description

      There seems to be no intuitive way to concatenate strings in the value attribute of the set tag:

      <s:set name="a" value="%

      {'/jsp/'+#parameters.file}

      " />

      sets "a" to "/jsp/[Ljava.lang.String;@1bd2184", it also didn't help to enforce evaluation as a string:

      <s:set name="a" value="%

      {'/jsp/'+#parameters.file.toString()}

      " />

      Also in the Struts mailinglist no one could tell me, how to do that, even though I got an excellent reply:

      http://www.nabble.com/forum/ViewPost.jtp?post=13825946&framed=y

      I think there should be an intuitive way to do that, for instance it works in the text tag:
      <s:text name="/jsp/%

      {#parameters.file}

      " />

      The same one of the following would be logical for the set tag:
      <s:set name="a" value="%

      {'/jsp/' + #parameters.file}

      " />
      <s:set name="a" value="%

      {'/jsp/'#parameters.file}

      " />

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            apulix Anton Pussep
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: