本文整理匯總了Java中javax.servlet.http.HttpServletResponse.encodeURL方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpServletResponse.encodeURL方法的具體用法?Java HttpServletResponse.encodeURL怎麽用?Java HttpServletResponse.encodeURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.servlet.http.HttpServletResponse
的用法示例。
在下文中一共展示了HttpServletResponse.encodeURL方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doGet
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* Almost minimal processing for a servlet.
*
* @param nextUrl The url the caller would like to go to next. If
* supplied, put an encoded url into the returned
* html page as a hyperlink.
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/plain");
PrintWriter out = resp.getWriter();
out.print("OK");
String param = req.getParameter("nextUrl");
if (param!=null) {
// append an encoded url to carry the sessionids
String targetUrl = resp.encodeURL(param);
out.print(". You want to go <a href=\"");
out.print(targetUrl);
out.print("\">here next</a>.");
}
}
示例2: handleRequestInternal
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
@Override
protected ModelAndView handleRequestInternal(final HttpServletRequest request,
final HttpServletResponse response) throws Exception {
final String url = request.getContextPath() + "/manage.html";
LOGGER.debug("Initial url is [{}]", url);
final String encodedUrl = response.encodeURL(url);
LOGGER.debug("Encoded url is [{}]", encodedUrl);
return new ModelAndView(new RedirectView(encodedUrl));
}
示例3: getBookmarkUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取最新章節URL
*
* @return 最新章節URL
*/
public String getBookmarkUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
String url = response.encodeURL(ReaderAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno()
+ "&chapterno=" + getChapterno());
if (YiDuConstants.yiduConf.getBoolean(YiDuConfig.ENABLE_PINYINURL, false)) {
url = response.encodeURL(ReaderAction.URL + "?pinyin=" + getPinyin() + "&chapterno=" + getChapterno());
}
return url;
}
示例4: getLastChapterUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取最新章節URL
*
* @return 最新章節URL
*/
public String getLastChapterUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
String url = response.encodeURL(ReaderAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno()
+ "&chapterno=" + getLastchapterno());
if (YiDuConstants.yiduConf.getBoolean(YiDuConfig.ENABLE_PINYINURL, false)) {
url = response.encodeURL(ReaderAction.URL + "?pinyin=" + getPinyin() + "&chapterno=" + getLastchapterno());
}
return url;
}
示例5: getChapterListUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取章節列表URL
*
* @return 分類列表URL
*/
public String getChapterListUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
String url = response.encodeURL(ChapterListAction.URL + "?subdir=" + getSubdir() + "&articleno="
+ getArticleno());
if (YiDuConstants.yiduConf.getBoolean(YiDuConfig.ENABLE_PINYINURL, false)) {
url = response.encodeURL(ChapterListAction.URL + "?pinyin=" + getPinyin());
}
return url;
}
示例6: getUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取小說介紹頁URL
*
* @return 小說介紹頁URL
*/
public String getUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
String url = response.encodeURL(InfoAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno());
if (YiDuConstants.yiduConf.getBoolean(YiDuConfig.ENABLE_PINYINURL, false)) {
url = response.encodeURL(InfoAction.URL + "?pinyin=" + getPinyin());
}
return url;
}
示例7: getAddVoteUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取推薦小說URL
*
* @return 推薦小說URL
*/
public String getAddVoteUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(VoteAction.URL + "?articleno=" + getArticleno());
}
示例8: getInfoUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取小說介紹頁URL
*
* @return 小說介紹頁URL
*/
public String getInfoUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(InfoAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno());
}
示例9: getPreChapterThumbnailUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取下一章章節URL
*
* @return 上一章章節URL
*/
public String getPreChapterThumbnailUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(ReaderAction.URL + "?chapterno=" + getPreChapterno());
}
示例10: getReviewUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取小說評價URL
*
* @return 小說評價URL
*/
public String getReviewUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(ReviewListAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno());
}
示例11: getThumbnailUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取章節URL
*
* @return 章節URL
*/
public String getThumbnailUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(ReaderAction.URL + "?chapterno=" + getChapterno());
}
示例12: getDownloadUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取下載小說URL
*
* @return 下載小說URL
*/
public String getDownloadUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(DownloadAction.URL + "?subdir=" + getSubdir() + "&articleno=" + getArticleno());
}
示例13: getAddBookcaseUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取加入書簽URL
*
* @return 加入書簽URL
*/
public String getAddBookcaseUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(BookcaseAction.URL + "!add?articleno=" + getArticleno());
}
示例14: getAuthorUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取作者列表URL
*
* @return 作者列表URL
*/
public String getAuthorUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(ArticleListAction.URL + "?author=" + getAuthor());
}
示例15: getSubscribeUrl
import javax.servlet.http.HttpServletResponse; //導入方法依賴的package包/類
/**
* 獲取訂閱URL
*
* @return 訂閱URL
*/
public String getSubscribeUrl() {
HttpServletResponse response = ServletActionContext.getResponse();
return response.encodeURL(SubscribeAction.URL + "!add?articleno=" + getArticleno());
}