• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

Jsp test page

发布: 2007-7-04 13:34 | 作者: admin | 来源:  网友评论 | 查看: 16次 | 进入软件测试论坛讨论

领测软件测试网
author:DiegoYun
date:2005-1-21
desc:jsp test page
--%>
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.util.Enumeration,
java.util.Iterator,
java.util.Collection,
java.util.ArrayList"%>
<p>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#000000">
<tr>
<td width="20%" bgcolor="#CCCCCC">Request URI</td>
<%
//get Request URI and put it in a string
String requestUri = request.getRequestURI();
%>
<td bgcolor="#33CCFF"><%=requestUri%></td>
</tr>
</table>
<br>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#000000">
<tr bgcolor="#0099FF">
<td colspan="2">Request Parameter</td>
</tr>
<tr>
<td width="20%" bgcolor="#CCCCCC">Parameter Name</td>
<td bgcolor="#33CCFF">Parameter Value</td>
</tr>
<%
Enumeration enParaNames = request.getParameterNames();
String sParaName = "" ;
String sParaValue = "" ;
while(enParaNames.hasMoreElements())
{
sParaName = (String)enParaNames.nextElement();
%>
<tr>
<td bgcolor="#CCCCCC"><%=sParaName%></td>
<%
String[] sParaValues;
sParaValues = request.getParameterValues(sParaName);
int i;
for(i = 0;i<sParaValues.length;i++)
{
if (i == 0)
{
sParaValue = sParaValues[i];
}
else
{
sParaValue = sParaValue + "," + sParaValues[i];
}
}
if (sParaValue.length() == 0)
{
sParaValue = "&nbsp;";
}
%>
<td bgcolor="#33CCFF"><%=sParaValue%></td>
</tr>
<%}%>
</table>
<br>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#000000">
<tr bgcolor="#0099FF">
<td colspan="2">Request Attribute</td>
</tr>
<tr>
<td width="20%" bgcolor="#CCCCCC">Attribute Name</td>
<td bordercolor="#000000" bgcolor="#33CCFF">Attribute Value</td>
</tr>
<%
Enumeration enAttrNames = request.getAttributeNames();
String sAttrName = "" ;
String sAttrValue = "" ;
while(enAttrNames.hasMoreElements())
{
sAttrName = (String)enAttrNames.nextElement();
%>
<tr>
<td bgcolor="#CCCCCC"><%=sAttrName%></td>
<%
Object objX = request.getAttribute(sAttrName);
if (objX instanceof String)
{
sAttrValue = (String)objX;
}
else
{
sAttrValue = objX.toString();
}

if (sAttrValue.length() == 0)
{
sAttrValue = "&nbsp;";
}

%>
<td bgcolor="#33CCFF"><%=sAttrValue%></td>
</tr>
<%}%>
</table>
<br>
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#000000">
<tr bgcolor="#0099FF">
<td colspan="2">Session Attribute</td>
</tr>
<tr>
<td width="20%" bgcolor="#CCCCCC">Attribute Name</td>
<td bgcolor="#33CCFF">Attribute Value</td>
</tr>
<%
Enumeration enSesNames = session.getAttributeNames();
String sSesName = "" ;
String sSesValue = "" ;
while(enSesNames.hasMoreElements())
{
sSesName = (String)enSesNames.nextElement();
%>
<tr>
<td width="20%" bgcolor="#CCCCCC"><%=sSesName%></td>
<%
Object o = session.getAttribute(sSesName);
if (o instanceof String)
{
sSesValue = (String)o;
}
else
{
sSesValue = o.toString();
}

if (sSesValue.length() == 0)
{
sSesValue = "&nbsp;";
}

%>
<td bgcolor="#33CCFF"><%=sSesValue%></td>
</tr>
<%}%>
</table>
</p>








作者Blog:http://blog.csdn.net/WalkingWithJava/

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网