jsp页面导出excel 并且可以弹出保存对话框
主要在jsp页面加入
<%@ page contentType="application/msexcel;charset=GBK"%>
<%
response.setHeader("Content-disposition",
"attachment; filename=shouExcel.xls");
%>
完整页面如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ page contentType="application/msexcel;charset=GBK"%>
<%
response.setHeader("Content-disposition",
"attachment; filename=shouExcel.xls");
%>
<html>
<head>
<title>导出</title>
</head>
<body>
<table width="100%" border="1" cellpadding="1" cellspacing="1">
<tr>
<td height="22">
<div align="center">
<strong>设备名称</strong>
</div>
</td>
<td height="22">
<div align="center">
<strong>错误类型</strong>
</div>
</td>
<td height="22">
<div align="center">
<strong>次数</strong>
</div>
</td>
<td>
<div align="center">
<strong>时间</strong>
 
相关文档:
首先你要有tomcat,还要有oracle jdbc的jar档等环境.
第一步: 写JSP
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@(des ......
1.request对象
客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。
序号 方 法 说 明
1 object getAttribute(String name) 返回指定属性的属性值
2 Enumeration getAttributeNames() 返回所有可用属性名的枚举
3 String getCharacterEncoding( ......
EOS6中在JSP页面中读取页面流中的DataObject对象
代码如下:
<%@page pageEncoding="UTF-8" import="java.util.*"%>
<%@page import="com.eos.web.taglib.util.*" %>
<%@page import="commonj.sdo.DataObject,commonj.sdo.Property" %>
<%@include file="/common/common.jsp"%>
<%@incl ......
<%@ page c language="java"%>
<%@ page import="com.dragon.*" %>
<%@ page import="lotus.domino.*" %>
<%! ......