本文整理了Java中org.restlet.Response.redirectPermanent
方法的一些代码示例,展示了Response.redirectPermanent
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.redirectPermanent
方法的具体详情如下:
包路径:org.restlet.Response
类名称:Response
方法名:redirectPermanent
[英]Permanently redirects the client to a target URI. The client is expected to reuse the same method for the new request.
If you pass a relative target URI, it will be resolved with the current base reference of the request's resource reference (see Request#getResourceRef() and Reference#getBaseRef().
[中]将客户端永久重定向到目标URI。客户机应该对新请求重用相同的方法。
如果传递相对目标URI,它将使用请求的资源引用的当前基引用进行解析(请参见请求#getResourceRef()和引用#getBaseRef()。
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Permanently redirects the client to a target URI. The client is expected
* to reuse the same method for the new request.
*
* @param targetRef
* The target URI reference.
*/
@Override
public void redirectPermanent(Reference targetRef) {
getWrappedResponse().redirectPermanent(targetRef);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Permanently redirects the client to a target URI. The client is expected
* to reuse the same method for the new request.
*
* @param targetUri
* The target URI.
*/
@Override
public void redirectPermanent(String targetUri) {
getWrappedResponse().redirectPermanent(targetUri);
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Permanently redirects the client to a target URI. The client is expected
* to reuse the same method for the new request.
*
* @param targetRef
* The target URI reference.
*/
public void redirectPermanent(Reference targetRef) {
if (getResponse() != null) {
getResponse().redirectPermanent(targetRef);
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Permanently redirects the client to a target URI. The client is expected
* to reuse the same method for the new request.<br>
* <br>
* If you pass a relative target URI, it will be resolved with the current
* base reference of the request's resource reference (see {@link Request#getResourceRef()} and
* {@link Reference#getBaseRef()}.
*
* @param targetUri
* The target URI.
*/
public void redirectPermanent(String targetUri) {
if (getResponse() != null) {
getResponse().redirectPermanent(targetUri);
}
}
代码示例来源:origin: com.whizzosoftware.hobson.hub/hobson-hub-setup
@Override
public void handle(Request request, Response response) {
Reference ref = request.getResourceRef();
if (PATH.equals(ref.getPath()) || (PATH + "/").equals(ref.getPath())) {
response.redirectPermanent(PATH + "/index.html");
} else {
super.handle(request, response);
}
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
response.redirectPermanent(targetRef);
break;
内容来源于网络,如有侵权,请联系作者删除!