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

重写后的 HTML 页

<html>
Testing JavaScript DJS Functions
<br>
<script>
menu.addItem(new NavBarMenuItem
("All Available Information","javaScript:top.location=
\qgateway-URL/http://abc.sesta.com\q"));

// abc.sesta.com 是网关服务的“域和子域的代理”列表中的一项。因此重写器需要重写这个 URL。但由于是一个绝对 URL,所以不需要在其前面加 Portal Server URL。此 DJS 规则规定需要重写 DJS 函数 NavBarMenuItem 的第二个参数。但第二个参数还是一个 JavaScript 变量。此时还需要第二项规则来重写该变量的值。第二项规则指定需要重写 JavaScript 变量 top.location 的值。由于满足上述所有条件,所以会重写此 URL。

//menu.addItem(new NavBarMenuItem("All Available Information","http://abc.sesta.com"));

// 虽然此 DJS 规则指定需要重写函数 NavBarMenuItem 的第二个参数,但在本语句中不会发生这种情况。这是因为重写器不会将第二个参数识别为简单 HTML。

</script>
</html>