本文整理汇总了Java中org.apache.commons.lang3.StringEscapeUtils.escapeEcmaScript方法的典型用法代码示例。如果您正苦于以下问题:Java StringEscapeUtils.escapeEcmaScript方法的具体用法?Java StringEscapeUtils.escapeEcmaScript怎么用?Java StringEscapeUtils.escapeEcmaScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.StringEscapeUtils
的用法示例。
在下文中一共展示了StringEscapeUtils.escapeEcmaScript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderHead
import org.apache.commons.lang3.StringEscapeUtils; //导入方法依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
String encodedAttachmentSupport;
if (getAttachmentSupport() != null) {
encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtils.serialize(getAttachmentSupport()));
encodedAttachmentSupport = StringUtils.deleteWhitespace(encodedAttachmentSupport);
encodedAttachmentSupport = StringEscapeUtils.escapeEcmaScript(encodedAttachmentSupport);
encodedAttachmentSupport = "'" + encodedAttachmentSupport + "'";
} else {
encodedAttachmentSupport = "undefined";
}
String callback = ajaxBehavior.getCallbackFunction(explicit("action"), explicit("param1"), explicit("param2"),
explicit("param3")).toString();
String autosaveKey = getAutosaveKey();
if (autosaveKey != null)
autosaveKey = "'" + JavaScriptEscape.escapeJavaScript(autosaveKey) + "'";
else
autosaveKey = "undefined";
String script = String.format("gitplex.server.markdown.onDomReady('%s', %s, %d, %s, %d, %b, %b, %s);",
container.getMarkupId(),
callback,
ATWHO_LIMIT,
encodedAttachmentSupport,
getAttachmentSupport()!=null?getAttachmentSupport().getAttachmentMaxSize():0,
getUserMentionSupport() != null,
getPullRequestReferenceSupport() != null,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.markdown.onWindowLoad('%s');", container.getMarkupId());
response.render(OnLoadHeaderItem.forScript(script));
}