ecm:urlEncode
    • 1 Minute to read
    • Dark
      Light

    ecm:urlEncode

    • Dark
      Light

    Article summary

    The function ecm:urlEncode encodes the specified object as a URL. The value returned is a string data type.

    Example

    A registration link is included in a message that takes the information stored in the recipient attribute user.LastName and passes it as a variable to the registration page.

    URL encoding ensures that last names with spaces (de la Hoya, van der Waal) or special characters (Nuñez, Köhl) do not break the link.

    The HTML for inserting the link in a message is constructed as follows:

    <a href="">Registerhttp://host/cmd.jsp?user=<%${ecm:urlEncode(user['LastName'])}%>">Register</a>

    Structure​

    ecm:urlEncode(object)

    Parameters​

    Parameter

    Description

    object

    Specifies the target object to encode.


    Was this article helpful?