主頁 > 知識庫 > 獲取jsp各種參數(shù)

獲取jsp各種參數(shù)

熱門標(biāo)簽:珠海銷售外呼系統(tǒng)運營商 四川電信外呼系統(tǒng)靠譜嗎 廣州三五防封電銷卡 外呼系統(tǒng)啥意思 電銷外呼系統(tǒng) 排行榜 長春回?fù)芡夂粝到y(tǒng)廠家 地圖標(biāo)注制作道路 地圖標(biāo)注創(chuàng)業(yè)項目入駐 山東智能云外呼管理系統(tǒng)
package coreservlets;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

/** Creates a table showing the current value of each
* of the standard CGI variables.
* P>
* Taken from Core Servlets and JavaServer Pages
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* copy; 2000 Marty Hall; may be freely used or adapted.
*/

public class ShowCGIVariables extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String[][] variables =
{ { "AUTH_TYPE", request.getAuthType() },
{ "CONTENT_LENGTH",
String.valueOf(request.getContentLength()) },
{ "CONTENT_TYPE", request.getContentType() },
{ "DOCUMENT_ROOT",
getServletContext().getRealPath("/") },
{ "PATH_INFO", request.getPathInfo() },
{ "PATH_TRANSLATED", request.getPathTranslated() },
{ "QUERY_STRING", request.getQueryString() },
{ "REMOTE_ADDR", request.getRemoteAddr() },
{ "REMOTE_HOST", request.getRemoteHost() },
{ "REMOTE_USER", request.getRemoteUser() },
{ "REQUEST_METHOD", request.getMethod() },
{ "SCRIPT_NAME", request.getServletPath() },
{ "SERVER_NAME", request.getServerName() },
{ "SERVER_PORT",
String.valueOf(request.getServerPort()) },
{ "SERVER_PROTOCOL", request.getProtocol() },
{ "SERVER_SOFTWARE",
getServletContext().getServerInfo() }
};
String title = "Servlet Example: Showing CGI Variables";
out.println(ServletUtilities.headWithTitle(title) +
"BODY BGCOLOR=\&;#FDF5E6\&;>\n" +
"H1 ALIGN=\&;CENTER\&;>" + title + "/H1>\n" +
"TABLE BORDER=1 ALIGN=\&;CENTER\&;>\n" +
"TR BGCOLOR=\&;#FFAD00\&;>\n" +
"TH>CGI Variable NameTH>Value");
for(int i=0; ivariables.length; i++) {
String varName = variables[i][0];
String varValue = variables[i][1];
if (varValue == null)
varValue = "I>Not specified/I>";
out.println("TR>TD>" + varName + "TD>" + varValue);
}
out.println("/TABLE>/BODY>/HTML>");
}

/** POST and GET requests handled identically. */

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}





您可能感興趣的文章:
  • jsp提交到Servlet報404錯誤問題解決(webroot下子目錄)
  • jsp include引用非本級目錄網(wǎng)頁實現(xiàn)代碼
  • 兩個JSP頁面父頁面獲取子頁面內(nèi)容的兩種方法
  • JSP 獲取Spring 注入對象示例
  • jsp頁面獲取服務(wù)器時間的簡單調(diào)用示例
  • jsp獲取action傳來的session和session清空以及判斷
  • JSP自定義標(biāo)簽獲取用戶IP地址的方法
  • jsp中獲取狀態(tài)怎么寫(兩種實現(xiàn)方式)
  • JSP中獲取ExtJS.Ajax前臺傳遞的JSON數(shù)據(jù)實現(xiàn)過程
  • JSP 獲取真實IP地址的代碼
  • jsp中獲取當(dāng)前目錄的方法

標(biāo)簽:保定 北海 紹興 潮州 玉樹 廣元 肇慶 吳忠

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《獲取jsp各種參數(shù)》,本文關(guān)鍵詞  獲取,jsp,各種,參數(shù),獲取,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《獲取jsp各種參數(shù)》相關(guān)的同類信息!
  • 本頁收集關(guān)于獲取jsp各種參數(shù)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章