JSP±¨±í´òÓ¡µÄÒ»ÖÖ¼òµ¥½â¾ö·½°¸
1. ÔÚWord»òExcelÖÐÖÆ×÷±¨±íµÄÑùʽ¡£
¡¡¡¡ExcelµÄÐиߺÍÁÐ¿íµ¥Î»ÎÞ·¨ÓÃmm»òcm±íʾ¡£
¡¡¡¡ÐèÒª¼ÆËã¡£ÔÚ1024*768Ï£¬1CMԼΪ38ÏñËØ¡£
¡¡¡¡ÒÔ´ËΪ»ù×¼£¬¿É¼ÆËã²¢¿ØÖƱ¨±íµÄÐÐÁÐλÖá£
¡¡¡¡2. ÔÚWordÖÐÉèÖÓ±í¸ñ——±êÌâÐÐÖظ´”¡£
¡¡¡¡ÔÚExcelÖÐÉèÖÓÎļþ——Ò³ÃæÉèÖ×—¹¤×÷±í——´òÓ¡±êÌ┡£
¡¡¡¡3. Áí´æΪÍøÒ³£¬¸Äºó׺Ãû“htm”Ϊ“jsp”¡£
¡¡¡¡4. Word±¨±íÎļþͷΪ£º
£¼%@page contentType="application/msword;charset=GBK" language="java"%£¾
¡¡¡¡Excel±¨±íÎļþͷΪ£º
£¼% @page contentType="application/vnd.ms-excel;charset=GBK" language="java"%£¾
¡¡¡¡5. ÔÚÎļþÍ·²¿·Ö¶¨Òå´òÓ¡²ÎÊý±äÁ¿ÈçÏ£¨ÒÔExcelΪÀý£©£º
£¼%
//ÐèÒª´òÓ¡µÄ¼Ç¼ÌõÊý
int PrintRowCount=RowCount;
//ÿҳ´òÓ¡µÄ¼Ç¼ÌõÊý
int PageRowCount=16;
//×îºóÒ»Ò³ÐèÒª´òÓ¡µÄ¿ÕÐеÄÊýÄ¿
int LoopNum=PageRowCount-PrintRowCount%PageRowCount;
//´òÓ¡ÇøÓòµÄ¸ß¶È£¬ÆäÖÐ2µÄÒâ˼ÊÇÿҳÐèÒªÖظ´µÄ±êÌâÐеÄÊýÄ¿
int PrintAreaHeight=(PrintRowCount%PageRowCount==0)?PrintRowCount+2:PrintRowCount+LoopNum+2;
%£¾
¡¡¡¡6. ÔÚ£¼style£¾£¼/style£¾ºó£¬¸Ä¶¯£¼!--[if gte mso 9]Ó룼![endif]--£¾±êÇ©ÖеÄXML±êÇ©ÄÚÈÝ£¬Ö÷ÒªÊÇÉèÖö¯Ì¬´òÓ¡ÇøÓò£¨ÒÔExcelΪÀý£©£º
£¼%
out.print(" ......
"£¼x:ExcelName£¾"+
"£¼x:Name£¾Print_Area£¼/x:Name£¾"+
"£¼x:SheetIndex£¾1£¼/x:SheetIndex£¾"+
"£¼x:Formula£¾=Sheet1!$A$1:$G$"+PrintAreaHeight+"£¼/x:Formula£¾"+
"£¼/x:ExcelName£¾"+
...... ");
%£¾
¡¡¡¡7. JSPÆäËû±àÂë¡£
¡¡¡¡ÏÂÃæÊÇÖ÷ÌåÑ»·´òÓ¡²¿·Ö£¨ÒÔExcelΪÀý£©£º
£¼%
for (int i=1;i£¼=PrintRowCount; i++)
{
out.print("£¼tr£¾"£¼td£¾"+i+"£¼/td£¾£¼/tr£¾"); //ÓÐÄÚÈÝ
}
if (LoopNum!=PageRowCount) //ÓпÕÐÐÔò´òÓ¡¿ÕÐв¹Æë×îÄ©Ò»Ò³
for (int j=1;j£¼=LoopNum; j++)
{
out.print("£¼tr£¾£¼td£¾¡¡£¼/td£¾£¼/tr£¾");//ÎÞÄÚÈÝ
}
%£¾
¡¡¡¡8. ²âÊÔ²¢¼ÌÐøÐ޸ġ£
ÎÄÕÂÀ´×Ô: ºÃϲ°®Ñ§Ï°Íø(http://www.haoxiai.net) ÍøÖ·£ºhttp://www.haoxiai.net/bianchengyuyan/jspjiaocheng/58877.html
Ïà¹ØÎĵµ£º
javascriptдjavaû¹Øϵ,ÖÁÓÚΪʲôÃû×ÖÕâôÏà½ü,¿ÉÄÜÊÇÒòΪjavaºÜÓÐÃûÆøËùÒÔ°ÑÃû×ÖÈ¡³É²î²»¶àµÄ,Ò»ÖÖÐÂÓïÑÔ¸Õ³öÀ´µÄʱºòÒªµãÃûÆøÀ´³öÃû°É~~
javascriptËãÊÇÒ»ÖÖhtml½Å±¾ÄÜÖ±½ÓÖ´ÐеÄÓïÑÔ°É,jspÒª±àÒë²ÅÄÜÖ´ÐÐ,Äã×Ô¼ºÐ´¸öJSP²»¿ªtomcatÖ®ÀàµÄÊÇÎÞ·¨Ö´ÐеÄ.JSPºÍJAVAµÄÇø±ð,JSPËãÊÇJAVAÒ»ÖÖ¼¼Êõ°É,ÓÃÔÚÍøÒ³±à³ÌÉÏ,ÒòΪJAVA² ......
Ò»¡¢
ÎÊ£ºorg.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
´ð£ºPostgreSQÊý¾Ý¿âΪÁË°²È«£¬Ëü²»»á¼àÌý³ý±¾µØÒÔÍâµÄËùÓÐÁ¬½ÓÇëÇ󣬵±Óû§Í¨¹ýJDBC·ÃÎÊÊÇ£¬¾Í»á±¨Ò»Ð©ÒÔÉϵÄÒì³£¡£Òª½â¾öÕâ¸öÎÊÌâ ......
ÒÔÇ°ÓÐÌáµ½¹ýÂÒÂëÎÊÌ⣬×î½üÔÚʹÓÃwindow.openʱÓÖ³öÏÖ´ËÀàÎÊÌ⣬ÏÖ½â¾öÈçÏ£º
1£ºÊ¹ÓÃencodeURIComponentº¯Êý¶Ô²ÎÊý½øÐд¦Àí£¬ÀýÈ磺window.open("html.jsp?name=" + encodeUrlComponent(value)));
2£ºÐÞ¸Ätomcat·þÎñÆ÷µÄserver.xmlÎļþÌí¼Ó£ºuseBodyEncodingForURI="true"»òÕß
URIEncoding=" ......
struts-config:
<action path="/articleManage" name="articleManageForm" scope="request" type="auction.action.ArticleManageAction" validate="false">
<forward name="atriclesList" path="/WEB-INF/publish/articleManage/atriclesList.jsp"/>
<forward ......