锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品中文字幕一区二区,最新91在线,欧美综合一区二区http://www.aygfsteel.com/joessy/category/404.html璁板綍宸ヤ綔涓亣鍒扮殑闂鍙婅В鍐沖姙娉?/description>zh-cnThu, 01 Mar 2007 20:53:48 GMTThu, 01 Mar 2007 20:53:48 GMT60鑾峰彇JSP涓墍鏈夊弬鏁癧杞琞http://www.aygfsteel.com/joessy/articles/1397.html宸ヤ綔鏃ュ織宸ヤ綔鏃ュ織Mon, 21 Feb 2005 08:54:00 GMThttp://www.aygfsteel.com/joessy/articles/1397.htmlhttp://www.aygfsteel.com/joessy/comments/1397.htmlhttp://www.aygfsteel.com/joessy/articles/1397.html#Feedback0http://www.aygfsteel.com/joessy/comments/commentRss/1397.htmlhttp://www.aygfsteel.com/joessy/services/trackbacks/1397.html
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 Name<TH>Value"); 
for(int i=0; i<variables.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); 
}
 
}
 


]]>
主站蜘蛛池模板: 永兴县| 财经| 汉源县| 武城县| 长顺县| 双牌县| 文山县| 咸阳市| 平乐县| 五原县| 钟祥市| 修文县| 阿瓦提县| 莒南县| 双桥区| 天全县| 古丈县| 九江县| 平和县| 革吉县| 镇坪县| 红原县| 洪江市| 石台县| 日照市| 沁源县| 昌江| 永州市| 林口县| 工布江达县| 大姚县| 天台县| 葵青区| 东平县| 安多县| 昭通市| 台安县| 太康县| 高陵县| 类乌齐县| 驻马店市|