Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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дµÄÑéÖ¤Âë

µÚÒ»²½£º½¨Á¢Ò»¸öcode.jspµÄÒ³Ã棬²úÉúËæ»úÂë
   <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"
     import="java.io.*,
          java.util.*,
       & ......

JSP/servlet¿ª·¢µãµÎ

1.²¿ÊðÈýÖÖ·½Ê½£º
   (1) ÔÚserver.xmlµÄHost±êÇ©ÄÚн¨Ò»¸öContext±êÇ©
     <Context path="/learn1" reloadable="true" docBase="E:\work\tech\project\learn1\WebRoot" workDir="E:\work\tech\project\learn1\WebRoot\work" />
      * workDirÊÇÖ¸To ......

jspÁ¬½Ósql2005

ÔÚ¹ÜÀí¹¤¾ßÀïÃæÓÐÊý¾ÝÔ´   Ñ¡ÔñsqlÊý¾ÝÔ´
ÔÚ´úÂëÖУº
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page  import="java.sql.*"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content= ......

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>
< ......

webʵÑ鱨¸æ——±íµ¥ÓëJSPÄÚÖöÔÏó

Ò»¡¢ÊµÑéÄ¿µÄ
1¡¢ ÕÆÎÕ±íµ¥µÄʹÓ÷½·¨£¬ÒÔ¼°·þÎñÆ÷¶Ë´¦Àí±íµ¥ÇëÇóµÄ·½·¨£»
2¡¢ Àí½âForwardµÄ×÷Óã»
3¡¢ ÊìÁ·ÔËÓÃJSPµÄµäÐÍÄÚÖöÔÏó
 
¶þ¡¢ÊµÑéÄÚÈݼ°²½Öè
1¡¢±íµ¥µÄʹÓü°ÆäµÝ½»¡¢´¦Àí¹ý³Ì
ÔÚÔ­´´½ÌÎñϵͳÖУ¬ÏµÍ³»á¸ù¾ÝÓû§ÀàÐÍ(½Ìʦ/ѧÉú)ÏÔʾ²»Í¬µÄÒ³Ã档ΪģÄâ¸Ã¹¦ÄÜ£¬ÐèÒª¶¨ÒåÉè¼ÆÈçÏÂҳà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ