Description
This plugin will encode the characters of a string into their hex equivalent making it a very simple way to obfuscate data such as e-mail addresses that you do not want to expose to crawlers or e-mail spammers.
Installation and Setup
In your /WEB-INF/classes/blojsom-plugins.xml file, add the following:
<bean id="simple-obfuscation" class="org.blojsom.plugin.obfuscation.SimpleObfuscationPlugin" init-method="init"
destroy-method="destroy"/>
You may then add "simple-obfuscation" to one of the flavor-based plugin chains.
Usage and URL Parameters
There are no URL parameters to control the operation of the Simple Obfuscation plugin.
Context Attributes and Types
The following table describes the context attributes that are available and their associated type.
| Context key |
Input or Output |
Type |
Description |
| BLOJSOM_PLUGIN_SIMPLE_OBFUSCATION |
Output |
org.blojsom.plugin.obfuscation.SimpleObfuscationPlugin object |
You may then make use of the obfuscate method in your templates. If a null value is passed to the obfuscate method, a null is returned. If a blank value is passed to the obfuscate, a blank value is returned. Otherwise, the obfuscate method will return a string of the form %xx.... |