miercuri, 9 septembrie 2015

[OmniFaces utilities 2.0] URL-prettify the given string


[OmniFaces utilities] The prettyURL() function URL-prettify the given string. It performs the following tasks:
  • Lowercase the string.
  • Remove combining diacritical marks.
  • Replace non-alphanumeric characters by hyphens.

Function:
Usage:

Below you can see several examples of using of:prettyURL() function:

<c:set var="url" value="http://www.omnifaces-fans.org/2015/01/jsf-22-and-expression-language-30-el-30.html"/>
#{of:prettyURL(url)}
Output: http-www-omnifaces-fans-org-2015-01-jsf-22-and-expression-language-30-el-30-html

<c:set var="url" value="https://twitter.com/hashtag/RebelHeartTour?src=tren"/>
#{of:prettyURL(url)}
Output: https-twitter-com-hashtag-rebelhearttour-src-tren

<c:set var="url" value="http http://wiki.netbeans.org/wiki/index.php?title=DevFaqIdentifyMain&amp;action=history"/>
#{of:prettyURL(url)}
Output: http-wiki-netbeans-org-wiki-index-php-title-devfaqidentifymain-action-history

Niciun comentariu:

Trimiteți un comentariu