Sun Java System Portal Server Secure Remote Access 7.2 管理指南

HTML 表單範例

Procedure使用表單範例

  1. 您可自下列路徑存取表單範例:

    portal-server-URL/rewriter/HTML/forms/formrule.html

  2. 請確定您已於閘道服務的 [網域與子網域的代理伺服器] 清單中定義 abc.sesta.com

    若未定義,則會採用直接連接,且不前置閘道 URL。

  3. 將此範例中指定的規則新增至 [重新寫入 HTML 屬性的規則] 部分的 default_gateway_ruleset 中。

  4. 在 Portal Server 管理主控台的 Portal Server 配置下,編輯 Rewriter 服務中的 default_gateway_ruleset

  5. 從終端機視窗重新啟動閘道:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>
    

重新寫入前的 HTML 網頁

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
RW_START
<p>
<form name="form1" method="Post" action=
"http://abc.sesta.com/casestudy/html/form.html">
<input type="hidden" name="name1" value="0|1234|/test.html">
<input type="hidden" name="name3" value="../../html/test.html">
<form name="form2" method="Post" action="
http://abc.sesta.com/testcases/html/form.html"><br>
<input type="hidden" name="name1" value="0|1234|
../../html/test.html"></form>
RW_END </p>
</body>
</html>

規則

<Form source="*" name="form1" field="name1" valuePatterns="0|1234|"/>

重新寫入後的 HTML 網頁

<HTML>
<HEAD>
RW_START
</HEAD>
<BODY>
<P>
<FORM name=form1  method=POST action="gateway-URL/http://abc.sesta.com/casestudy/html/form.html">

// 重新寫入此 URL 是因為已在 default_gateway_ruleset 中將 <Attribute name="action"/> 定義為 HTML 規則的一部分。由於此 URL 應該是絕對 URL,因此僅需前置閘道 URL。請確定您已於閘道服務的 [網域與子網域的代理伺服器] 清單中定義 abc.sesta.com。否則,會認為是直接連接,而不會前置閘道 URL。

<input type=hidden name=name1 value=
"0|1234|gateway URL/portal-server-URL/test.html">

// 此處的表單名稱為 form1,而欄位名稱則為 name1。上述名稱與規則中指定的表單名稱與欄位名稱相符。規則指出 valuePatterns0|1234|,其符合此陳述式中的 value。因此會重新寫入出現在 valuePattern 之後的 URL。將前置 Portal Server URL 與閘道 URL。請參閱在規則中與式樣相符以取得 valuePatterns 的詳細資訊。

<input type=hidden name=name3 value="../../html/test.html">

// 未重新寫入此 URL 是因為此 name 不符合規則中所指定的 field 名稱。

</FORM>
<FORM name=form2 method=POST action=
"gateway-URL/http://abc.sesta.com/casestudy/html/form.html"><BR>

// 重新寫入此 URL 是因為已在預設規則集中將 <Attribute name="action"/> 定義為 HTML 規則的一部分。由於此 URL 應該是絕對 URL,因此僅需前置閘道 URL。

<input type=hidden name=name1 value="0|1234|../../html/test.html">

// 不重新寫入此 URL 是因為此表單名稱不符合規則中所指定的名稱。

</FORM>
</BODY>
RW_END
</HTML>