|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
而学习JAVA我觉得最应该避免的就是:只学习,不思考,只记忆,不实践!cgi|js|变量<%--
何志强[hhzqq@21cn.com]
日期:2000-09-19
版本:1.0
功效:JSP例程-猎取各类CGI情况变量
--%>
<%@pagesession="false"import="java.util.*"%>
<%!
EnumerationenumNames;
StringstrName,strValue;
%>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<title>JSP例程-猎取各类CGI情况变量</title>
</head>
<body>
<tableborder=1cellspacing=0cellpadding=0align=center>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
<%
enumNames=request.getHeaderNames();
while(enumNames.hasMoreElements()){
strName=(String)enumNames.nextElement();
strValue=request.getHeader(strName);
%>
<tr>
<td><%=strName%></td>
<td><%=strValue%></td>
</tr>
<%
}
%>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
<tr>
<td>CharacterEncoding</td>
<td><%=request.getCharacterEncoding()%></td>
</tr>
<tr>
<td>CONTENT_LENGTH</td>
<td><%=request.getContentLength()%></td>
</tr>
<tr>
<td>CONTENT_TYPE</td>
<td><%=request.getContentType()%></td>
</tr>
<tr>
<td>SERVER_PROTOCOL</td>
<td><%=request.getProtocol()%></td>
</tr>
<tr>
<td>REMOTE_ADDR</td>
<td><%=request.getRemoteAddr()%></td>
</tr>
<tr>
<td>REMOTE_HOST</td>
<td><%=request.getRemoteHost()%></td>
</tr>
<tr>
<td>Scheme</td>
<td><%=request.getScheme()%></td>
</tr>
<tr>
<td>SERVER_NAME</td>
<td><%=request.getServerName()%></td>
</tr>
<tr>
<td>SERVER_PORT</td>
<td><%=request.getServerPort()%></td>
</tr>
<tr>
<td>AUTH_TYPE</td>
<td><%=request.getAuthType()%></td>
</tr>
<tr>
<td>REQUEST_METHOD</td>
<td><%=request.getMethod()%></td>
</tr>
<tr>
<td>PATH_INFO</td>
<td><%=request.getPathInfo()%></td>
</tr>
<tr>
<td>PATH_TRANSLATED</td>
<td><%=request.getPathTranslated()%></td>
</tr>
<tr>
<td>QUERY_STRING</td>
<td><%=request.getQueryString()%></td>
</tr>
<tr>
<td>REMOTE_USER</td>
<td><%=request.getRemoteUser()%></td>
</tr>
<tr>
<td>REQUEST_URI</td>
<td><%=request.getRequestURI()%></td>
</tr>
<tr>
<td>SCRIPT_NAME</td>
<td><%=request.getServletPath()%></td>
</tr>
</table>
</body>
</html>
关于第二点:俺问问你,如果是企业级项目的话,诸如RMI,EJB,等一些关键技术,这些难道都不需要学么?如果光是使用jsp,servlet,javabean的话。 |
|