Grails
  1. Grails
  2. GRAILS-4479

space characters in params in the remoteLink tag are not being translated to spaces in the controller action

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: TagLib
    • Labels:
      None

      Description

      Given a tag like the following:

      <g:remoteLink action="doIt" params="[param:'This is a test']">Testy</g:remoteLink>
      

      When actioned, in the controller the params.param string looks like this: "This+is+a+test". The '+'s should be translated back into spaces in the controller, as per the behaviour of g.link (which works as expected).

        Issue Links

          Activity

          Hide
          Damien Ferrand added a comment -

          Works for me in 1.1.1 and trunk.

          Show
          Damien Ferrand added a comment - Works for me in 1.1.1 and trunk.
          Hide
          Chris Brookes added a comment -

          This still does not work for me in 1.1.1 and 1.2-M2. Given the view and controller as follows:

          View
          <%@ page contentType="text/html;charset=UTF-8" %>
          <html>
          <head>
              <title>Simple GSP page</title>
              <g:javascript library="prototype/prototype" />
          </head>
          <body>
          
          <g:remoteLink action="doIt" params="[param:'This is a test']">Testy</g:remoteLink>
          
          </body>
          </html>
          
          Controller
          def doIt =
          {
              log.debug "$params"
          }
          

          Still shows the following in the debug:

          [param:This+is+a+test, action:doIt , controller:woo]

          The remoteLink tag gives the following html:

          <a onclick="new Ajax.Request('/testApp/woo/doIt',{asynchronous:true,evalScripts:true,parameters:'param=This+is+a+test'});
          return false;" href="/testApp/woo/doIt?param=This+is+a+test">Testy</a>
          

          My work around is to replace '+'s with spaces in the controller, but obviously this isn't going to work too well if there are valid '+'s in there (perhaps entrered by user).

          Show
          Chris Brookes added a comment - This still does not work for me in 1.1.1 and 1.2-M2. Given the view and controller as follows: View <%@ page contentType= "text/html;charset=UTF-8" %> <html> <head> <title>Simple GSP page</title> <g:javascript library= "prototype/prototype" /> </head> <body> <g:remoteLink action= "doIt" params= "[param:'This is a test']" >Testy</g:remoteLink> </body> </html> Controller def doIt = { log.debug "$params" } Still shows the following in the debug: [param:This+is+a+test, action:doIt , controller:woo] The remoteLink tag gives the following html: <a onclick=" new Ajax.Request('/testApp/woo/doIt',{asynchronous: true ,evalScripts: true ,parameters:'param=This+is+a+test'}); return false ;" href="/testApp/woo/doIt?param=This+is+a+test">Testy</a> My work around is to replace '+'s with spaces in the controller, but obviously this isn't going to work too well if there are valid '+'s in there (perhaps entrered by user).
          Hide
          Chris Brookes added a comment -

          Still doesn't work in 1.2.0...
          Affect Versions needs changing to reflect this.

          Show
          Chris Brookes added a comment - Still doesn't work in 1.2.0... Affect Versions needs changing to reflect this.

            People

            • Assignee:
              Unassigned
              Reporter:
              Chris Brookes
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Last Reviewed:

                Development