當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpServletResponse.encodeURL方法代碼示例

本文整理匯總了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>.");
    }
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:25,代碼來源:TesterServletEncodeUrl.java

示例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));
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:12,代碼來源:CasManagementRootController.java

示例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;
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:17,代碼來源:BookcaseDTO.java

示例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;
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:17,代碼來源:BookcaseDTO.java

示例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;
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:16,代碼來源:TArticle.java

示例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;
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:15,代碼來源:TArticle.java

示例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());
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:10,代碼來源:TArticle.java

示例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());
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:10,代碼來源:TChapter.java

示例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());
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:10,代碼來源:ChapterDTO.java

示例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());
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:10,代碼來源:TArticle.java

示例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());
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:10,代碼來源:TChapter.java

示例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());
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:10,代碼來源:TArticle.java

示例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());
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:10,代碼來源:TArticle.java

示例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());
}
 
開發者ID:Chihpin,項目名稱:Yidu,代碼行數:10,代碼來源:TArticle.java

示例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());
}
 
開發者ID:luckyyeah,項目名稱:YiDu-Novel,代碼行數:10,代碼來源:TArticle.java


注:本文中的javax.servlet.http.HttpServletResponse.encodeURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。