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);
%>
Ïà¹ØÎĵµ£º
Ò».ʲôÊÇcookies£¿
¡¡¡¡´ó¼Ò¶¼ÖªµÀ£¬ä¯ÀÀÆ÷ÓëWEB·þÎñÆ÷Ö®¼äÊÇʹÓÃHTTPÐÒé½øÐÐͨÐŵģ¬µ±Ä³¸öÓû§·¢³öÒ³ÃæÇëÇóʱ£¬WEB·þÎñÆ÷Ö»ÊǼòµ¥µÄ½øÐÐÏìÓ¦£¬È»ºó¾Í¹Ø±ÕÓë¸ÃÓû§µÄÁ¬½Ó¡£Òò´Ëµ±Ò»¸öÇëÇó·¢Ë͵½WEB·þÎñÆ÷ʱ£¬ÎÞÂÛÆäÊÇ·ñÊǵÚÒ»´ÎÀ´·Ã£¬·þÎñÆ÷¶¼»á°ÑËüµ±×÷µÚÒ»´ÎÀ´¶Ô´ý£¬ÕâÑùµÄ²»ºÃÖ®´¦¿ÉÏë¶øÖª¡£ÎªÁËÃÖ²¹Õâ¸öȱÏÝ£¬Netsc ......
½ñÌì²âÊÔÈËÔ±¸øÎÒÌáÁËÒ»¸öbug£¬ËµÎÒ¿ª·¢µÄÄ£¿é±¨¿ò¼ÜµÄjs´íÎ󣬵±Ê±Ò»Ìý¾ÍãÂÁË£¬ÎÒ±¾µØ²âÊÔÍêȫûÎÊÌ⣬ÔõôÉÏÁË·þÎñÆ÷»á³öÏÖÕâ¸öÎÊÌâÄØ£¿
ÓÚÊÇÎÒÈ¥·þÎñÆ÷ÉϲâÁËÒ»ÏÂ×Ô¼ºÐ´µÄÄǸöÄ£¿é£¬½á¹û±¨µÄ´íÎ󻹺ͲâÊÔÈËÔ±Ìá¸øÎҵĴíÎó²»Ò»Ö£¬ÔÓ»ØÊ£¿ÓÚÊÇÎÒÓÖÕÒµ½Ò»ÃûͬÊ£¬ÈÃËû°ïÎÒ²âһϣ ......
Ò»¡¢¸ÅÊö
»º´æµÄ˼Ïë¿ÉÒÔÓ¦ÓÃÔÚÈí¼þ·Ö²ãµÄ¸÷¸ö²ãÃæ¡£ËüÊÇÒ»ÖÖÄÚ²¿»úÖÆ£¬¶ÔÍâ½ç¶øÑÔ£¬ÊDz»¿É¸ÐÖªµÄ¡£
Êý¾Ý¿â±¾ÉíÓлº´æ£¬³Ö¾Ã²ãÒ²¿ÉÒÔ»º´æ¡££¨±ÈÈ磺hibernate£¬»¹·Ö1¼¶ºÍ2¼¶»º´æ£©
ÒµÎñ²ãÒ²¿ÉÒÔÓлº´æ£¨µ«Ò»°ãÀ´Ëµ£¬ÕâÊÇÒ»¸ö¹ý³ÌÓò£¬²»»áÉ軺´æ£©¡£
&nbs ......
ÔÚactionÀïʹÓÃfileuploadʱ£¬´ÓreqeustµÃµ½µÄÖÐÎÄÊý¾ÝΪÂÒÂ룬³¢ÊÔʹÓÃÁË
Java´úÂë
1. DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setHeaderEnco ......