Sun GlassFish Web Space Server 10.0 Secure Web Access Add-On Guide

HTML Page After Rewriting

<title>JavaScript DHTML Variable Test Page</title>
<script LANGUAGE="Javascript">
var dhtmlVar="<a href=gateway-URL/portal-server-URL

// The JavaScript DHTML rule identifies the right hand side of the dhtmlVar as dynamic HTML content. Hence, the HTML rules in the default_gateway_ruleset file are applied. The dynamic HTML contains a href attribute. The default_gateway_ruleset defines the rule <Attribute name="href"/>. Hence the value of the href attribute is rewritten. But the URL is not absolute; therefore, the relative URL is replaced with the base URL of the page, and the required subdirectories. This in turn is prefixed with the Gateway URL to derive the final rewritten output.

var dhtmlVar="<a href=gateway-URL

// Although the base URL of the page is appended, and the Gateway URL is prefixed, the resultant URL will not work. This is because the initial URL /../images/test.html is inaccurate.

var dhtmlVar="<a href=gateway-URL

// Here again, the JavaScript DHTML rule identifies the right hand side to be dynamic HTML content, and passes it to the HTML rules. The HTML rule <Attribute name="href"/> from the default_gateway_ruleset is applied, and the statement is rewritten as shown. The Gateway URL and Portal Server URL are prefixed.

var dhtmlVar="<a href=gateway URL/portal-server-URL/
var dhtmlVar="<a href=gateway URL/>"
var dhtmlVar="<img src=gateway-URL/>"

// The JavaScript DHTML rule identifies the dynamic HTML content on the right hand side, and passes the statement to the HTML rules. The <Attribute name="src"/> rule in the default_gateway_ruleset is applied. Because the URL is absolute, only the Gateway URL needs to be prefixed. Ensure that is defined in the Proxies for Domains and Subdomains list for this URL to be rewritten.

Testing DHTML Variables
<img src="gateway-URL/portal-server-URL/

// This line is rewritten because the rule <Attribute name="src"/> is defined in the default_gateway_ruleset.