common:URLEncode

This taglib lets encode a string according to the URLEncoding-scheme. Useful for sending parameters in url:s which contain special characters etc.

Parameters

Name Required Default Type Description
id true   Object/String The result is stored in this variable.
value true   Object/String The string we want to encode.
encoding false UTF-8 Object/String The encoding you wish to encode it by.
         
         
         

ID-result variable contains: A string-object.

Examples

<%@ taglib uri="infoglue-common" prefix="common" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<common:URLEncode id="encodedString" value="This is a string we want to encode" encoding="UTF-8"/>

Encoded string: <c:out value="${encodedString}"/><br/>

 

This will result in that the variable "encodedString" will contain an URLEncoded string ("This+is+a+string+we+want+to+encode").

 



comments powered by Disqus