易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP中输出CSV文件

<%@page import="com.opensymphony.xwork2.util.ValueStack"%><%
    ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");  
    String aa = (String)vs.findValue("downloadContent");
    response.setContentType("application/csv");
    response.setHeader("Content-Disposition", "inline; filename=result.csv");
    out.print(aa);
%>


相关文档:

JSP的九个内置对象介绍及用法

1.request对象
客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。
序号 方 法 说 明
1 object getAttribute(String name) 返回指定属性的属性值
2 Enumeration getAttributeNames() 返回所有可用属性名的枚举
3 String getCharacterEncoding( ......

jsp标准动作

//下面,从请求中得到属性 为一个 类,,会判断是否为null,,如为null则实例化
// id 值  相当于  class 的 对象名
<jsp:useBean id="order" class="com.entity.Order" scope="request" />
<==>
<%
 Order order=(Order)request.getAttribute("order");
 if(order==null)
  ......

jsp中的include静态页面出现乱码问题

在当前应用系统的web.xml里加入jsp-config代码:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<jsp-config>
< ......

JSP中页面自动定时刷新


1.JSP中页面定时刷新
Java
代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3C%25%0A%20%20 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号