Symbolic Substitution provides the developer with the mechanism to control the CSS, HTML and JavaScript directly from the Java Program and greatly reduces the complexity and size of the outbound payload for faster delivery and quicker web browser rendering.
For Example -
Java Program:
addSymbol("&ColorCode","Red");
addSymbol("&UserMessage","Alert");
addSymbol("&UserEmail","User@Email.com");
String jsonData = "{\"firstName\":\"John\",\"lastName\":\"Doe\"}";
addSymbol("&Payload",jsonData);
CSS:
.messageText {color: &ColorCode;}
Renders to:
.messageText {color: Red;}
HTML:
<p class='messageText'>&UserMessage<p>
Renders to:
<p class='messageText'>Alert</p>
JavaScript
function contactMessage()
{
window.location.href = "mailto:&UserEmail";
}
Renders to:
function contactMessage()
{
window.location.href = "mailto:User@Email.com";
}
var userInfo = '&Payload';
Renders to:
var userInfo = '{"firstName":"John","lastName":"Doe"}';