Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13453

Expose view url to render function in ScriptTemplateView

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 4.2.2
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Currently we pass 2 arguments to the script render function: the template content, and the model. The purpose of this improvement is to add an optional 3rd argument, which is the template url. That may be very useful for some use cases (cache management on script side for example).

        Issue Links

          Activity

          Hide
          sdeleuze Sébastien Deleuze added a comment -

          Resolved by commit f3b7e9f.

          Important note: this is a seamless change for Nashorn users that can still invoke either render(template, model) or render(template, model, url), but Jython and JRuby are less permissive and make it mandatory to declare the 3 parameters.

          As a consequence, Spring 4.2.0/4.2.1 Script templating users with Jython or JRuby should update their render function declaration from render(template, model) to render(template, model, url).

          Show
          sdeleuze Sébastien Deleuze added a comment - Resolved by commit f3b7e9f . Important note : this is a seamless change for Nashorn users that can still invoke either render(template, model) or render(template, model, url) , but Jython and JRuby are less permissive and make it mandatory to declare the 3 parameters. As a consequence, Spring 4.2.0/4.2.1 Script templating users with Jython or JRuby should update their render function declaration from render(template, model) to render(template, model, url) .

            People

            • Assignee:
              sdeleuze Sébastien Deleuze
              Reporter:
              sdeleuze Sébastien Deleuze
              Last updater:
              Sébastien Deleuze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 2 weeks, 3 days ago