Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-5762

Document the default friendly URL regex pattern of "[^//\.]"

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      The Liferay Friendly URL feature uses a regex to match parameter values. The default value for this regex is "[^//\.]" (source code) which matches all characters except forward slash ("\"), back slash ("/"), and period/dot ("."). Not matching forward slash and back slash is pretty intuitive since they are path separators intuitive characters for this default regex, but period is not. If someone expects to use the default regex for a resource URL (such as "/-/my-portlet/resource/javascripts.js") they may be surprised to find that it doesn't work. Since there is no error message and no indication of the default regex, there is no easy way to determine what the issue is.

      The current Friendly URL docs do not indicate what the default regex is:

      The pattern value /{entryId:\d+} matches a / followed by an entryId variable that matches the Java regular expression \d+—one or more numeric digits. For example, a URL /entryId, where the entryId value is 123 results in a URL value /123, which matches the pattern.

      The default regex should be documented.

      See also my StackOverflow Q&A about this: https://stackoverflow.com/questions/52638881/liferay-friendly-url-not-recognized-when-parameter-value-includes-period-do/52638882

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package