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="*"]/>

where

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:

http://test.siroe.com/testcases/html/form.html

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=
"http://test.siroe.com/testcases/html/form.html">
<input type=hidden name=abc1 value="0|1234|/test.html">
</form>

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

Rules

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

Output

<FORM name=”form1” 
method=”POST” action="gateway-URL/
http://test.siroe.com/testcases/html/form.html">
<input type=hidden name=abc1 
value="0|1234|gateway-URL/
http://test.siroe.com/test.html">
</FORM>

Description

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.