为什么 @EncodeURL 似乎不起作用?
Why does the @EncodeURL appear not to work?
我有一个简单的页面,用于尝试和测试扩展库中的 @EncodeUrl 函数:
<xp:panel id="encodeurl">
<xp:inputText value="#{viewScope.encodeurl}" />
<xp:br />
<xp:text value="#{javascript:var x = @EncodeUrl(viewScope.encodeurl); print( x ); return x; }"
escape="true" />
<xp:button value="submit" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="encodeurl">
</xp:eventHandler>
</xp:button>
</xp:panel>
使用表格进行编码
http://127.0.0.2/BlogTesting.nsf/ExtLibURLFormulas.xsp?my_Parameter=spaces and $ymbol$
没有像我预期的那样编码 as exampled elsewhere,即:
http://127.0.0.2/BlogTesting.nsf/ExtLibURLFormulas.xsp?my_Parameter=spaces+and+%24ymbol%24
相反,我在控制台和屏幕上得到的都是相同的字符串。我已经在 stock 9.0 安装和带有扩展库 v17 的 9.0.1FP7 上进行了尝试。
我是不是漏掉了什么?
@EncodeUrl 与您预期的不同。它
Adds any necessary attributes to a Domino® URL, such as a session
identifier or parameters.
使用
java.net.URLEncoder.encode("your string to encode", "utf-8")
相反。它对 URL.
中的空格和特殊字符进行编码
只编码参数,而不是整个 URL。另外,不要对参数分隔符 &
或参数 name-value 分隔符 =
.
进行编码
我有一个简单的页面,用于尝试和测试扩展库中的 @EncodeUrl 函数:
<xp:panel id="encodeurl">
<xp:inputText value="#{viewScope.encodeurl}" />
<xp:br />
<xp:text value="#{javascript:var x = @EncodeUrl(viewScope.encodeurl); print( x ); return x; }"
escape="true" />
<xp:button value="submit" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="encodeurl">
</xp:eventHandler>
</xp:button>
</xp:panel>
使用表格进行编码
http://127.0.0.2/BlogTesting.nsf/ExtLibURLFormulas.xsp?my_Parameter=spaces and $ymbol$
没有像我预期的那样编码 as exampled elsewhere,即:
http://127.0.0.2/BlogTesting.nsf/ExtLibURLFormulas.xsp?my_Parameter=spaces+and+%24ymbol%24
相反,我在控制台和屏幕上得到的都是相同的字符串。我已经在 stock 9.0 安装和带有扩展库 v17 的 9.0.1FP7 上进行了尝试。
我是不是漏掉了什么?
@EncodeUrl 与您预期的不同。它
Adds any necessary attributes to a Domino® URL, such as a session identifier or parameters.
使用
java.net.URLEncoder.encode("your string to encode", "utf-8")
相反。它对 URL.
中的空格和特殊字符进行编码
只编码参数,而不是整个 URL。另外,不要对参数分隔符 &
或参数 name-value 分隔符 =
.