- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.escapeForUrl()
方法的一些代码示例,展示了WebUtilities.escapeForUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebUtilities.escapeForUrl()
方法的具体详情如下:
包路径:com.github.bordertech.wcomponents.WebUtilities
类名称:WebUtilities
方法名:escapeForUrl
[英]Escapes the given string to make it presentable in a URL. This follows RFC 3986, with some extensions for UTF-8.
[中]转义给定字符串,使其在URL中可见。这是RFC 3986之后的版本,并对UTF-8进行了一些扩展。
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* This is a slightly different version of appendGetParam that doesn't encode the ampersand seperator. It is
* intended to be used in urls that are generated for javascript functions.
*
* @param key the key to append
* @param value the value to append
* @param vars the existing query string
* @param existingVars true if there are already existing query string key/value pairs
*/
public static void appendGetParamForJavascript(final String key, final String value,
final StringBuffer vars, final boolean existingVars) {
vars.append(existingVars ? '&' : '?');
vars.append(key).append('=').append(WebUtilities.escapeForUrl(value));
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* <p>
* Appends a key/value pair to a query string.</p>
*
* <p>
* A '{@literal ?}' or '{@literal &}' token will first be appended to the end of the vars StringBuffer, according to
* the presence of other vars. We quote the '{@literal &}' using XML character entity, because otherwise the
* resulting URL will be invalid XML parsed character data and so we can't generate XHTML.</p>
*
* @param key the key to append
* @param value the value to append
* @param vars the existing query string
* @param existingVars true if there are already existing query string key/value pairs
*/
public static void appendGetParam(final String key, final String value,
final StringBuffer vars, final boolean existingVars) {
vars.append(existingVars ? "&" : "?");
vars.append(key).append('=').append(WebUtilities.escapeForUrl(value));
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* <p>
* Retrieves the complete path to the theme's XSLT. This method takes the current theme and user's locale into
* account.
* </p>
* <p>
* Note: The XSLT is the single integration point to the client-side rendering.
* </p>
*
* @param uic the current user's UIContext.
* @return the theme XSLT.
*/
public static String getThemeXslt(final UIContext uic) {
String themePath = uic.getEnvironment().getThemePath();
StringBuffer path = new StringBuffer(themePath.length() + 20);
// Path
path.append(themePath);
if (themePath.length() > 0 && !themePath.endsWith("/")) {
path.append('/');
}
path.append("xslt/");
path.append(getThemeXsltName());
// Add cache busting suffix
path.append("?build=").append(WebUtilities.escapeForUrl(THEME_BUILD))
.append("&theme=").append(WebUtilities.escapeForUrl(THEME_NAME));
return path.toString();
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testEscapeForUrl() {
Assert.
assertEquals("Incorrectly encoded null string", null, WebUtilities.
escapeForUrl(null));
Assert.assertEquals("Incorrectly encoded empty string", "", WebUtilities.escapeForUrl(""));
Assert.
assertEquals("Incorrectly encoded 1 char string", "x", WebUtilities.
escapeForUrl("x"));
Assert.assertEquals("Incorrectly encoded 1 special char string", "%20", WebUtilities.
escapeForUrl(" "));
// Text with multiple escapes
String in = "Hello world slash/ question? amper& quote\" apos'";
String expected = "Hello%20world%20slash%2f%20question%3f%20amper%26%20quote%22%20apos%27";
Assert.assertEquals("Incorrectly escaped url", expected, WebUtilities.escapeForUrl(in));
// Extended characters - 2 char encoding
in = "\u0451";
expected = "%d1%91";
Assert.assertEquals("Incorrectly escaped url", expected, WebUtilities.escapeForUrl(in));
// Extended characters - 3 char encoding
in = "\u1eae";
expected = "%e1%ba%ae";
Assert.assertEquals("Incorrectly escaped url", expected, WebUtilities.escapeForUrl(in));
// Extended characters - 2 and 3 char encoding
in = "_\u0451\u1eae_";
expected = "_%d1%91%e1%ba%ae_";
Assert.assertEquals("Incorrectly escaped url", expected, WebUtilities.escapeForUrl(in));
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testGetThemeXslt() {
String themePath = "/testGetThemeXslt";
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, themePath);
String build = ThemeUtil.getThemeBuild();
String themeName = ThemeUtil.getThemeName();
String versionSuffix = "?build=" + WebUtilities.escapeForUrl(build) + "&theme=" + WebUtilities.
escapeForUrl(themeName);
UIContext uic = createUIContext();
Assert.assertEquals("Incorrect theme path", themePath + "/xslt/all.xsl" + versionSuffix,
ThemeUtil.getThemeXslt(uic));
uic.setLocale(Locale.ENGLISH); // We used to fetch a different XSL file based on locale, this is no longer the case.
Assert.assertEquals("Incorrect theme path", themePath + "/xslt/all.xsl" + versionSuffix,
ThemeUtil.getThemeXslt(uic));
uic.setLocale(Locale.CANADA_FRENCH); // We used to fetch a different XSL file based on locale, this is no longer the case.
Assert.assertEquals("Incorrect theme path",
themePath + "/xslt/all.xsl" + versionSuffix, ThemeUtil.getThemeXslt(uic));
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
+ WebUtilities.escapeForUrl("Test mailto launch"));
link5.setTargetWindowName(null);
add(link5);
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities类的一些代码示例,展示了WebUtilities类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中com.github.bordertech.wcomponents.WText类的一些代码示例,展示了WText类的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getParentNamingContext()方法的一些代码示例,展示了WebUti
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.render()方法的一些代码示例,展示了WebUtilities.render()的
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getContextForComponent()方法的一些代码示例,展示了WebUti
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.doubleEncodeBrackets()方法的一些代码示例,展示了WebUtili
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.percentEncodeUrl()方法的一些代码示例,展示了WebUtilities
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getPath()方法的一些代码示例,展示了WebUtilities.getPath(
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getClosestOfClass()方法的一些代码示例,展示了WebUtilitie
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.renderWithTransformToHTML()方法的一些代码示例,展示了Web
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.doubleDecodeBrackets()方法的一些代码示例,展示了WebUtili
本文整理了Java中com.github.bordertech.wcomponents.WText.setEncodeText()方法的一些代码示例,展示了WText.setEncodeText()的
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.escapeForUrl()方法的一些代码示例,展示了WebUtilities.esc
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.encode()方法的一些代码示例,展示了WebUtilities.encode()的
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getComponentById()方法的一些代码示例,展示了WebUtilities
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.generateRandom()方法的一些代码示例,展示了WebUtilities.g
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getProjectVersion()方法的一些代码示例,展示了WebUtilitie
本文整理了Java中com.github.bordertech.wcomponents.WText.getData()方法的一些代码示例,展示了WText.getData()的具体用法。这些代码示例主
本文整理了Java中com.github.bordertech.wcomponents.WText.getParent()方法的一些代码示例,展示了WText.getParent()的具体用法。这些代
本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.getAncestorOfClass()方法的一些代码示例,展示了WebUtiliti
我是一名优秀的程序员,十分优秀!