 JavaScript System 변수 예제를 사용하려면
JavaScript System 변수 예제를 사용하려면이 예제는 다음에서 액세스할 수 있습니다.
portal-server-URL /rewriter/JavaScript/variables/system/system.html
이 예제에 지정된 규칙을 "JavaScript 소스 재작성을 위한 규칙" 부분의 default_gateway_ruleset에 추가하십시오(아직 없는 경우).
Portal Server 관리 콘솔에 있는 Portal Server 구성의 Rewriter 서비스에서 default_gateway_ruleset을 편집합니다.
게이트웨이를 다시 시작합니다.
| ./psadmin start-sra-instance –u amadmin – f <password file> –N <profile name>– t <gateway> | 
<html>
<head>
<title>JavaScript SYSTEM Variables Test Page</title>
</head>
<body>
<script LANGUAGE="Javascript">
<!--
//SYSTEM Var
alert(window.location.pathname);
//document.write
("<A HREF="+window.location.pathname+">SYSTEM</A><P>")
//-->
</SCRIPT>
Testing JavaScript SYSTEM Variables
<br>
This page displays the path where 
the current page is located when loaded.
</body>
</html>
<Variable name=”window.location.pathname” type="SYSTEM"/>
<html> <head> <title>JavaScript SYSTEM Variables Test Page</title> </head> <body> <SCRIPT> convertsystem function definition... </SCRIPT> <script LANGUAGE="Javascript"> <!-- //SYSTEM Var alert(psSRAPRewriter_convert_system (window.location, window.location.pathname,”window.location”));
// Rewriter는 window.location.pathname을 JavaScript SYSTEM 변수로 인식합니다. 이 변수의 값은 서버 쪽에서 결정할 수 없습니다. 따라서 Rewriter는 변수 앞에 psSRAPRewriter_convert_pathname 함수를 덧붙입니다. 이 래퍼 함수는 클라이언트 쪽에서 변수의 값을 결정하고 필요에 따라 다시 작성합니다.
//--> </SCRIPT> Testing JavaScript SYSTEM Variables <br> This page displays the path where the current page is located when loaded. </body> </html>