本文整理了Java中org.kohsuke.stapler.StaplerRequest.getOriginalRestOfPath()
方法的一些代码示例,展示了StaplerRequest.getOriginalRestOfPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StaplerRequest.getOriginalRestOfPath()
方法的具体详情如下:
包路径:org.kohsuke.stapler.StaplerRequest
类名称:StaplerRequest
方法名:getOriginalRestOfPath
[英]Returns the same thing as #getRestOfPath() but in the pre-decoded form, so all "%HH"s as present in the request URL is intact.
[中]返回与#getRestOfPath()相同的内容,但以预解码的形式返回,因此请求URL中的所有“%HH”都是完整的。
代码示例来源:origin: jenkinsci/jenkins
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active)
if(req.getUserPrincipal()==null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath()+req.getOriginalRestOfPath();
String q = req.getQueryString();
if(q!=null)
path += '?'+q;
rsp.sendRedirect2(path);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (req.getUserPrincipal() == null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath() + req.getOriginalRestOfPath();
String q = req.getQueryString();
if (q != null) {
path += '?' + q;
}
rsp.sendRedirect2(path);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active)
if(req.getUserPrincipal()==null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath()+req.getOriginalRestOfPath();
String q = req.getQueryString();
if(q!=null)
path += '?'+q;
rsp.sendRedirect2(path);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (req.getUserPrincipal() == null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath() + req.getOriginalRestOfPath();
String q = req.getQueryString();
if (q != null) {
path += '?' + q;
}
rsp.sendRedirect2(path);
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (req.getUserPrincipal() == null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath() + req.getOriginalRestOfPath();
String q = req.getQueryString();
if (q != null) {
path += '?' + q;
}
rsp.sendRedirect2(path);
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Checks if the user was successfully authenticated.
*
* @see BasicAuthenticationFilter
*/
public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
if (req.getUserPrincipal() == null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath() + req.getOriginalRestOfPath();
String q = req.getQueryString();
if (q != null) {
path += '?' + q;
}
rsp.sendRedirect2(path);
}
内容来源于网络,如有侵权,请联系作者删除!