润乾报表中常用的测试环境JSP(下)



在报表的部署以及使用中,经常会遇到一些数据源或者环境配置方面的问题,本文中就提供了两个测试常用的JSP,可以在出现相关问题时用来进行测试。

TestAWT.jsp–测试服务器端图形环境的jsp。一些统计图无法展现等图形问题,都是由于图形环境没有配置正确造成的。

<%@ page language=”java” contentType=”text/html; charset=GB18030″
pageEncoding=”GB18030″%>
<jsp:directive.page import=”com.runqian.report4.model.expression.graph.DrawBase”/>
<jsp:directive.page import=”java.awt.Color”/>
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”;
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=GB18030″>
<title>Insert title here</title>
</head>
<body>
<%
response.setHeader(”Cache-Control”,”no-cache”);
try{
new DrawBase(){
public void draw(StringBuffer arg0){
Color color =new Color(palette.getColor(0));
g.setColor(color);
g.drawRect(300,300,500,500);

}
};
%>
可以构建JAVA图形环境
<%
}catch(Exception e){
e.printStackTrace();
%>
无法构建JAVA图形环境
<%
}
%>
</body>
</html>

all_prop.jsp–测试环境编码的jsp。系统环境的编码如果不正确,会导致中文字体或图形显示方块或乱码,用这个jsp可以测试出系统的环境编码。

<%@ page language=”java” contentType=”text/html; charset=GB18030″
pageEncoding=”GB18030″%>
<jsp:directive.page import=”java.util.Properties”/>
<jsp:directive.page import=”java.util.Set”/>
<jsp:directive.page import=”java.util.Iterator”/>
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=GB18030″>
<title>Insert title here</title>
</head>
<body>
<table>
<tr>
<td>属性</td>
<td>值</td>
</tr>
<%
Properties props = System.getProperties();
Set keys = props.keySet();

for(Iterator iter = keys.iterator();iter.hasNext();){
String key = (String)iter.next();
if(”file.encoding”.equalsIgnoreCase(key)){
String value = props.getProperty(key);
%>
<tr>
<td><%=key %></td>
<td><%=value %></td>
</tr>
<%
}
}
%>
</table>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值