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

Form Rules for HTML Content

The HTML pages that a user browses may contain forms. Some form elements may take a URL as the value.

This section is divided into the following parts:

Form Rule Syntax

<Form name="form1" field="visit" [valuePatterns="" source="*"]/>


name is the name of the form (mandatory)

field is the field in the form whose value needs to be rewritten (mandatory)

valuePatterns See Using Pattern Matching in Rules

source is the URL of the html page where this form definition is present (optional, default *, meaning in any page)

Form Rule Example

Assume the base URL of the page is:

Page Content

Assume the page URI is form.html and is located in the root directory of the server.

<form name=form1  method=POST action=
<input type=hidden name=abc1 value="0|1234|/test.html">

To rewrite /text.html present in the value of hidden field named abc1 which is part of form1. The following rules are needed.


<Form source="*/form.html" name="form1" 
field="abc1" valuePatterns="0|1234|"/>
<Attribute name="action"/>


<FORM name=”form1” 
method=”POST” action="gateway-URL/">
<input type=hidden name=abc1 


The action tag is rewritten using some defined HTML attribute rule.

The input tag attribute value’s value is rewritten as shown in the output. The specified valuePatterns is located, and all content following the matched valuePatterns is rewritten by prefixing the Gateway URL, and the base URL of the page. See Using Pattern Matching in Rules.