あなたはSSJSコードでそれをクリアする必要があり、サーバ側オブジェクトです。 CSJSから直接クリアすることはできませんが、CSJSからSSJSコードを呼び出すことはできます。 CSJSからSSJSを呼び出すには、拡張ライブラリのJSON-RPCサービスを使用できます。ここで
は一例です。
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:jsonRpcService id="jsonRpcService1" serviceName="myRpcService">
<xe:this.methods>
<xe:remoteMethod name="clearSessionScope">
<xe:this.script>
<![CDATA[
var iterator = sessionScope.keySet().iterator();
while(iterator.hasNext()){
sessionScope.remove(iterator.next());
}
return "sessionScope cleared";
]]>
</xe:this.script>
</xe:remoteMethod>
</xe:this.methods>
</xe:jsonRpcService>
<xp:button value="Clear sessionScope" id="button1">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<![CDATA[
var deferred = myRpcService.clearSessionScope();
deferred.addCallback(function(result) {
alert(result);
});
]]>
</xp:this.script>
</xp:eventHandler>
</xp:button>
</xp:view>
おかげで - 私は今週後半に試してみるだろう。 –