本文整理汇总了Java中org.apache.catalina.util.RequestUtil.URLDecode方法的典型用法代码示例。如果您正苦于以下问题:Java RequestUtil.URLDecode方法的具体用法?Java RequestUtil.URLDecode怎么用?Java RequestUtil.URLDecode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.util.RequestUtil
的用法示例。
在下文中一共展示了RequestUtil.URLDecode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Add a URL pattern to be part of this web resource collection.
*/
public void addPattern(String pattern) {
if (pattern == null)
return;
String decodedPattern = RequestUtil.URLDecode(pattern);
String results[] = new String[patterns.length + 1];
for (int i = 0; i < patterns.length; i++) {
results[i] = patterns[i];
}
results[patterns.length] = decodedPattern;
patterns = results;
}
示例2: setLocation
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Set the location.
*
* @param location The new location
*/
public void setLocation(String location) {
// if ((location == null) || !location.startsWith("/"))
// throw new IllegalArgumentException
// ("Error Page Location must start with a '/'");
this.location = RequestUtil.URLDecode(location);
}
示例3: addURLPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void addURLPattern(String urlPattern) {
if ("*".equals(urlPattern)) {
this.matchAllUrlPatterns = true;
} else {
String[] results = new String[urlPatterns.length + 1];
System.arraycopy(urlPatterns, 0, results, 0, urlPatterns.length);
results[urlPatterns.length] = RequestUtil.URLDecode(urlPattern);
urlPatterns = results;
}
}
示例4: addPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Add a URL pattern to be part of this web resource collection.
*/
public void addPattern(String pattern) {
if (pattern == null)
return;
pattern = RequestUtil.URLDecode(pattern);
String results[] = new String[patterns.length + 1];
for (int i = 0; i < patterns.length; i++) {
results[i] = patterns[i];
}
results[patterns.length] = pattern;
patterns = results;
}
示例5: setLocation
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Set the location.
*
* @param location
* The new location
*/
public void setLocation(String location) {
// if ((location == null) || !location.startsWith("/"))
// throw new IllegalArgumentException
// ("Error Page Location must start with a '/'");
this.location = RequestUtil.URLDecode(location);
}
示例6: addURLPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void addURLPattern(String urlPattern) {
if ("*".equals(urlPattern)) {
this.matchAllUrlPatterns = true;
} else {
String[] results = new String[urlPatterns.length + 1];
System.arraycopy(urlPatterns, 0, results, 0, urlPatterns.length);
results[urlPatterns.length] = RequestUtil.URLDecode(urlPattern);
urlPatterns = results;
}
}
示例7: addPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Add a URL pattern to be part of this web resource collection.
*/
public void addPattern(String pattern) {
if (pattern == null)
return;
pattern = RequestUtil.URLDecode(pattern);
String results[] = new String[patterns.length + 1];
for (int i = 0; i < patterns.length; i++)
results[i] = patterns[i];
results[patterns.length] = pattern;
patterns = results;
}
示例8: addPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Add a URL pattern to be part of this web resource collection.
*/
public void addPattern(String pattern) {
if (pattern == null)
return;
String decodedPattern = RequestUtil.URLDecode(pattern);
String results[] = new String[patterns.length + 1];
for (int i = 0; i < patterns.length; i++) {
results[i] = patterns[i];
}
results[patterns.length] = decodedPattern;
patterns = results;
}
示例9: getContextPath
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Return the portion of the request URI used to select the Context
* of the Request. The value returned is not decoded which also implies it
* is not normalised.
*/
@Override
public String getContextPath() {
String canonicalContextPath = getServletContext().getContextPath();
String uri = getRequestURI();
char[] uriChars = uri.toCharArray();
int lastSlash = mappingData.contextSlashCount;
// Special case handling for the root context
if (lastSlash == 0) {
return "";
}
int pos = 0;
// Need at least the number of slashes in the context path
while (lastSlash > 0) {
pos = nextSlash(uriChars, pos + 1);
if (pos == -1) {
break;
}
lastSlash--;
}
// Now allow for path parameters, normalization and/or encoding.
// Essentially, keep extending the candidate path up to the next slash
// until the decoded and normalized candidate path (with the path
// parameters removed) is the same as the canonical path.
String candidate;
if (pos == -1) {
candidate = uri;
} else {
candidate = uri.substring(0, pos);
}
candidate = removePathParameters(candidate);
candidate = RequestUtil.URLDecode(candidate, connector.getURIEncoding());
candidate = org.apache.tomcat.util.http.RequestUtil.normalize(candidate);
boolean match = canonicalContextPath.equals(candidate);
while (!match && pos != -1) {
pos = nextSlash(uriChars, pos + 1);
if (pos == -1) {
candidate = uri;
} else {
candidate = uri.substring(0, pos);
}
candidate = removePathParameters(candidate);
candidate = RequestUtil.URLDecode(candidate, connector.getURIEncoding());
candidate = org.apache.tomcat.util.http.RequestUtil.normalize(candidate);
match = canonicalContextPath.equals(candidate);
}
if (match) {
if (pos == -1) {
return uri;
} else {
return uri.substring(0, pos);
}
} else {
// Should never happen
throw new IllegalStateException(sm.getString(
"coyoteRequest.getContextPath.ise", canonicalContextPath, uri));
}
}
示例10: setLoginPage
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void setLoginPage(String loginPage) {
// if ((loginPage == null) || !loginPage.startsWith("/"))
// throw new IllegalArgumentException
// ("Login Page resource path must start with a '/'");
this.loginPage = RequestUtil.URLDecode(loginPage);
}
示例11: setErrorPage
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void setErrorPage(String errorPage) {
// if ((errorPage == null) || !errorPage.startsWith("/"))
// throw new IllegalArgumentException
// ("Error Page resource path must start with a '/'");
this.errorPage = RequestUtil.URLDecode(errorPage);
}
示例12: setErrorPage
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void setErrorPage(String errorPage) {
// if ((errorPage == null) || !errorPage.startsWith("/"))
// throw new IllegalArgumentException
// ("Error Page resource path must start with a '/'");
this.errorPage = RequestUtil.URLDecode(errorPage);
}
示例13: getContextPath
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
* Return the portion of the request URI used to select the Context of the
* Request. The value returned is not decoded which also implies it is not
* normalised.
*/
@Override
public String getContextPath() {
String canonicalContextPath = getServletContext().getContextPath();
String uri = getRequestURI();
char[] uriChars = uri.toCharArray();
int lastSlash = mappingData.contextSlashCount;
// Special case handling for the root context
if (lastSlash == 0) {
return "";
}
int pos = 0;
// Need at least the number of slashes in the context path
while (lastSlash > 0) {
pos = nextSlash(uriChars, pos + 1);
if (pos == -1) {
break;
}
lastSlash--;
}
// Now allow for path parameters, normalization and/or encoding.
// Essentially, keep extending the candidate path up to the next slash
// until the decoded and normalized candidate path (with the path
// parameters removed) is the same as the canonical path.
String candidate;
if (pos == -1) {
candidate = uri;
} else {
candidate = uri.substring(0, pos);
}
candidate = removePathParameters(candidate);
candidate = RequestUtil.URLDecode(candidate, connector.getURIEncoding());
candidate = org.apache.tomcat.util.http.RequestUtil.normalize(candidate);
boolean match = canonicalContextPath.equals(candidate);
while (!match && pos != -1) {
pos = nextSlash(uriChars, pos + 1);
if (pos == -1) {
candidate = uri;
} else {
candidate = uri.substring(0, pos);
}
candidate = removePathParameters(candidate);
candidate = RequestUtil.URLDecode(candidate, connector.getURIEncoding());
candidate = org.apache.tomcat.util.http.RequestUtil.normalize(candidate);
match = canonicalContextPath.equals(candidate);
}
if (match) {
if (pos == -1) {
return uri;
} else {
return uri.substring(0, pos);
}
} else {
// Should never happen
throw new IllegalStateException(
sm.getString("coyoteRequest.getContextPath.ise", canonicalContextPath, uri));
}
}
示例14: getDecodedRequestURI
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
@Override
public String getDecodedRequestURI() {
if (decodedRequestURI == null)
decodedRequestURI = RequestUtil.URLDecode(getRequestURI());
return decodedRequestURI;
}
示例15: setURLPattern
import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
public void setURLPattern(String urlPattern) {
this.urlPattern = RequestUtil.URLDecode(urlPattern);
}