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

DHTML 參數範例

假設此網頁的基準 URL 是:

http://xyz.siroe.com/test/rewriter/test1/jscript/JSFUNC/page.html

網頁內容

<script>
<!--
document.write(\q<a href="/index.html">write</a><BR>\q)
document.writeln(\q<a href="index.html">writeln</a><BR>\q)
document.write("http://abc.sesta.com/index.html<BR>")
document.writeln("http://abc.sesta.com/index.html<BR>")
//-->
</SCRIPT>

規則

<Function name="DHTML" name="document.write" paramPatterns="y"/>
<Function name="DHTML" name="document.writeln" paramPatterns="y"/>
<Attribute name="href"/>

輸出

<SCRIPT>
<!--
document.write(\q<a href="gateway-URL/
http://xyz.siroe.com/index.html">write</a><BR>\q)
document.writeln(\q<a href="gateway-URL/
http://xyz.siroe.com/test/rewriter/test1/
jscript/JSFUNC/index.html">writeln</a><BR>\q)
document.write("http://abc.sesta.com/index.html<BR>")
document.writeln("http://abc.sesta.com/index.html<BR>")
//-->
</SCRIPT>

描述

第一個規則指出 document.write 函數中的第一個參數需要重新寫入。第二個規則指出 document.writeln 函數中的第一個參數需要重新寫入。第三個規則是一個簡單 HTML 規則,指出名稱為 href 的所有屬性皆需重新寫入。在範例中,DHTML 參數規則會識別出函數中需重新寫入的參數。然後便套用 HTML 屬性規則,以實際重新寫入識別出的參數。