Click
  1. Click
  2. CLK-399

Adding URL encoding method to Format

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: core
    • Labels:
      None

      Description

      I propose adding URL encoding method which invokes ClickUtils#encodeUrl() to net.sf.click.util.Format.
      This method is useful to assemble link URLs in the HTML template.

      ========
      public String encodeUrl(Object object)

      { return ClickUtils.encodeUrl(object, Context.getThreadLocalContext()); }

      ========

      <a href="test.htm?name=$format.encodeUrl($name)">Link</a>

        Activity

        Hide
        Malcolm Edgar added a comment -

        +1

        I think this is a good idea.

        Show
        Malcolm Edgar added a comment - +1 I think this is a good idea.
        Hide
        Naoki Takezoe added a comment -

        Thanks Malcolm,

        I think Format#url() is better than Format#encodeUrl() because it's shorter.

        For example, Format#html() corresponds to ClickUtils#escapeHtml().
        We should keep Format object methods short as much as possible.

        Bob, can I do it?

        Show
        Naoki Takezoe added a comment - Thanks Malcolm, I think Format#url() is better than Format#encodeUrl() because it's shorter. For example, Format#html() corresponds to ClickUtils#escapeHtml(). We should keep Format object methods short as much as possible. Bob, can I do it?
        Hide
        Malcolm Edgar added a comment -

        Naoki, yes you can do this. You have committer privelleges

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Naoki, yes you can do this. You have committer privelleges regards Malcolm Edgar
        Hide
        Naoki Takezoe added a comment -

        Hi Malcolm,

        I don't have permission to assign this issue to me...
        Could you assign this issue to me?

        Show
        Naoki Takezoe added a comment - Hi Malcolm, I don't have permission to assign this issue to me... Could you assign this issue to me?
        Hide
        Naoki Takezoe added a comment -
        Show
        Naoki Takezoe added a comment - Fixed in trunk. http://svn.apache.org/viewvc?view=rev&revision=769220

          People

          • Assignee:
            Naoki Takezoe
            Reporter:
            Naoki Takezoe
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development