锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧洲日韩极速播放,亚洲精品在线播放视频,亚洲丶国产丶欧美一区二区三区http://www.tkk7.com/zhouzhou163/涓撴敞浜巎ava ee鎶鏈?鍖呮嫭struts,jsf,webwork,spring,hibernate,ibatiszh-cnSun, 11 May 2025 01:44:43 GMTSun, 11 May 2025 01:44:43 GMT60$_SERVER鐨勮緇嗗弬鏁?/title><link>http://www.tkk7.com/zhouzhou163/archive/2012/02/01/369142.html</link><dc:creator>robbin163</dc:creator><author>robbin163</author><pubDate>Wed, 01 Feb 2012 04:00:00 GMT</pubDate><guid>http://www.tkk7.com/zhouzhou163/archive/2012/02/01/369142.html</guid><wfw:comment>http://www.tkk7.com/zhouzhou163/comments/369142.html</wfw:comment><comments>http://www.tkk7.com/zhouzhou163/archive/2012/02/01/369142.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouzhou163/comments/commentRss/369142.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouzhou163/services/trackbacks/369142.html</trackback:ping><description><![CDATA[<div><p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 'Segoe UI', Tahoma, Arial; line-height: 26px; -webkit-text-size-adjust: none; background-color: #f5faff; "><br /></p><table border="0" cellspacing="0" cellpadding="6" width="95%" align="center" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; width: 641px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f5faff; font-family: 'Segoe UI', Tahoma, Arial; line-height: 26px; -webkit-text-size-adjust: none; border-bottom-color: #0099cc; border-bottom-width: 1px; border-bottom-style: solid; border-left-color: #0099cc; border-left-width: 1px; border-left-style: solid; table-layout: fixed; border-top-color: #0099cc; border-top-width: 1px; border-top-style: solid; border-right-color: #0099cc; border-right-width: 1px; border-right-style: solid; "><tbody><tr><td bgcolor="#ddedfb" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-left-color: #dddddd; word-wrap: break-word; ">$_SERVER['PHP_SELF'] #褰撳墠姝e湪鎵ц鑴氭湰鐨?span href="tag.php?name=%CE%C4%BC%FE">鏂囦歡</span>鍚嶏紝涓?document root鐩稿叧銆?br />$_SERVER['argv'] #浼犻掔粰璇ヨ剼鏈殑鍙傛暟銆?br />$_SERVER['argc'] #鍖呭惈浼犻掔粰<span href="tag.php?name=%B3%CC%D0%F2">紼嬪簭</span>鐨勫懡浠よ鍙傛暟鐨勪釜鏁幫紙濡傛灉榪愯鍦ㄥ懡浠よ妯″紡錛夈?br />$_SERVER['GATEWAY_INTERFACE'] #鏈嶅姟鍣ㄤ嬌鐢ㄧ殑 CGI 瑙勮寖鐨勭増鏈備緥濡傦紝“CGI/1.1”銆?br />$_SERVER['SERVER_NAME'] #褰撳墠榪愯鑴氭湰鎵鍦ㄦ湇鍔″櫒涓繪満鐨勫悕縐般?br />$_SERVER['SERVER_SOFTWARE'] #鏈嶅姟鍣ㄦ爣璇嗙殑瀛椾覆錛屽湪鍝嶅簲璇鋒眰鏃剁殑澶撮儴涓粰鍑恒?br />$_SERVER['SERVER_PROTOCOL'] #璇鋒眰<span href="tag.php?name=%D2%B3%C3%E6">欏甸潰</span>鏃墮氫俊鍗忚鐨勫悕縐板拰鐗堟湰銆備緥濡傦紝“HTTP/1.0”銆?br />$_SERVER['REQUEST_METHOD'] #<span href="tag.php?name=%B7%C3%CE%CA">璁塊棶</span>欏甸潰鏃剁殑璇鋒眰鏂規硶銆備緥濡傦細“GET”銆?#8220;HEAD”錛?#8220;POST”錛?#8220;PUT”銆?br />$_SERVER['QUERY_STRING'] #<span href="tag.php?name=%B2%E9%D1%AF">鏌ヨ</span>(query)鐨?span href="tag.php?name=%D7%D6%B7%FB">瀛楃</span>涓層?br />$_SERVER['DOCUMENT_ROOT'] #褰撳墠榪愯鑴氭湰鎵鍦ㄧ殑鏂囨。鏍圭洰褰曘傚湪鏈嶅姟鍣ㄩ厤緗枃浠朵腑瀹氫箟銆?br />$_SERVER['HTTP_ACCEPT'] #褰撳墠璇鋒眰鐨?Accept: 澶撮儴鐨勫唴瀹廣?br />$_SERVER['HTTP_ACCEPT_CHARSET'] #褰撳墠璇鋒眰鐨?Accept-Charset: 澶撮儴鐨勫唴瀹廣備緥濡傦細“iso-8859-1,*,utf-8”銆?br />$_SERVER['HTTP_ACCEPT_ENCODING'] #褰撳墠璇鋒眰鐨?Accept-Encoding: 澶撮儴鐨勫唴瀹廣備緥濡傦細“gzip”銆?br />$_SERVER['HTTP_ACCEPT_LANGUAGE']#褰撳墠璇鋒眰鐨?Accept-Language: 澶撮儴鐨勫唴瀹廣備緥濡傦細“en”銆?br />$_SERVER['HTTP_CONNECTION'] #褰撳墠璇鋒眰鐨?Connection: 澶撮儴鐨勫唴瀹廣備緥濡傦細“Keep-Alive”銆?br />$_SERVER['HTTP_HOST'] #褰撳墠璇鋒眰鐨?Host: 澶撮儴鐨勫唴瀹廣?br />$_SERVER['HTTP_REFERER'] #閾炬帴鍒板綋鍓嶉〉闈㈢殑鍓嶄竴欏甸潰鐨?URL 鍦板潃銆?br />$_SERVER['HTTP_USER_AGENT'] #褰撳墠璇鋒眰鐨?User_Agent: 澶撮儴鐨勫唴瀹廣?br />$_SERVER['HTTPS'] — 濡傛灉閫氳繃https璁塊棶,鍒欒璁句負涓涓潪絀虹殑鍊?on)錛屽惁鍒欒繑鍥瀘ff<br />$_SERVER['REMOTE_ADDR'] #姝e湪嫻忚褰撳墠欏甸潰鐢ㄦ埛鐨?IP 鍦板潃銆?br />$_SERVER['REMOTE_HOST'] #姝e湪嫻忚褰撳墠欏甸潰鐢ㄦ埛鐨勪富鏈哄悕銆?br />$_SERVER['REMOTE_PORT'] #鐢ㄦ埛榪炴帴鍒版湇鍔″櫒鏃舵墍浣跨敤鐨勭鍙c?br />$_SERVER['SCRIPT_FILENAME'] #褰撳墠鎵ц鑴氭湰鐨勭粷瀵硅礬寰勫悕銆?br />$_SERVER['SERVER_ADMIN'] #綆$悊鍛樹俊鎭?br />$_SERVER['SERVER_PORT'] #鏈嶅姟鍣ㄦ墍浣跨敤鐨勭鍙?br />$_SERVER['SERVER_SIGNATURE'] #鍖呭惈鏈嶅姟鍣ㄧ増鏈拰铏氭嫙涓繪満鍚嶇殑瀛楃涓層?br />$_SERVER['PATH_TRANSLATED'] #褰撳墠鑴氭湰鎵鍦ㄦ枃浠?span href="tag.php?name=%CF%B5%CD%B3">緋葷粺</span>錛堜笉鏄枃妗f牴鐩綍錛夌殑鍩烘湰璺緞銆?br />$_SERVER['SCRIPT_NAME'] #鍖呭惈褰撳墠鑴氭湰鐨勮礬寰勩傝繖鍦ㄩ〉闈㈤渶瑕佹寚鍚戣嚜宸辨椂闈炲父鏈夌敤銆?br />$_SERVER['REQUEST_URI'] #璁塊棶姝ら〉闈㈡墍闇鐨?URI銆備緥濡傦紝“/index.<span href="tag.php?name=html">html</span>”銆?br />$_SERVER['PHP_AUTH_USER'] #褰?PHP 榪愯鍦?Apache 妯″潡鏂瑰紡涓嬶紝騫朵笖姝e湪浣跨敤 HTTP 璁よ瘉鍔熻兘錛岃繖涓彉閲忎究鏄敤鎴瘋緭鍏ョ殑鐢ㄦ埛鍚嶃?br />$_SERVER['PHP_AUTH_PW'] #褰?PHP 榪愯鍦?Apache 妯″潡鏂瑰紡涓嬶紝騫朵笖姝e湪浣跨敤 HTTP 璁よ瘉鍔熻兘錛岃繖涓彉閲忎究鏄敤鎴瘋緭鍏ョ殑瀵嗙爜銆?br />$_SERVER['AUTH_TYPE'] #褰?PHP 榪愯鍦?Apache 妯″潡鏂瑰紡涓嬶紝騫朵笖姝e湪浣跨敤 HTTP 璁よ瘉鍔熻兘錛岃繖涓彉閲忎究鏄璇佺殑綾誨瀷銆?/td></tr></tbody></table></div><img src ="http://www.tkk7.com/zhouzhou163/aggbug/369142.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouzhou163/" target="_blank">robbin163</a> 2012-02-01 12:00 <a href="http://www.tkk7.com/zhouzhou163/archive/2012/02/01/369142.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>RadomCodeServlethttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86320.htmlrobbin163robbin163Fri, 08 Dec 2006 05:51:00 GMThttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86320.htmlhttp://www.tkk7.com/zhouzhou163/comments/86320.htmlhttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86320.html#Feedback0http://www.tkk7.com/zhouzhou163/comments/commentRss/86320.htmlhttp://www.tkk7.com/zhouzhou163/services/trackbacks/86320.html
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;

import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RadomCodeServlet extends HttpServlet
{

聽public void doGet(HttpServletRequest request, HttpServletResponse response)
聽聽聽throws ServletException, IOException {
聽聽doPost(request,response);
聽}


聽public void doPost(HttpServletRequest request, HttpServletResponse response)
聽聽聽throws ServletException, IOException {
聽聽//璁劇疆欏甸潰涓嶇紦瀛?br />聽聽response.setHeader("Pragma","No-cache");
聽聽response.setHeader("Cache-Control","no-cache");
聽聽response.setDateHeader("Expires", 0);
聽聽//鍦ㄥ唴瀛樹腑鍒涘緩鍥捐薄
聽聽int width=60, height=20;
聽聽BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

聽聽//鑾峰彇鍥懼艦涓婁笅鏂?br />聽聽Graphics g = image.getGraphics();

聽聽//鐢熸垚闅忔満綾?br />聽聽Random random = new Random();

聽聽//璁懼畾鑳屾櫙鑹?br />聽聽g.setColor(getRandColor(200,250));
聽聽g.fillRect(0, 0, width, height);

聽聽//璁懼畾瀛椾綋
聽聽g.setFont(new Font("Times New Roman",Font.PLAIN,18));
聽聽
聽聽//闅忔満浜х敓155鏉″共鎵扮嚎錛屼嬌鍥捐薄涓殑璁よ瘉鐮佷笉鏄撹鍏跺畠紼嬪簭鎺㈡祴鍒?br />聽聽g.setColor(getRandColor(160,200));
聽聽for (int i=0;i<155;i++)
聽聽{
聽聽聽聽聽聽聽聽聽 int x = random.nextInt(width);
聽聽聽聽聽聽聽聽聽 int y = random.nextInt(height);
聽聽聽聽聽聽聽聽聽 int xl = random.nextInt(12);
聽聽聽聽聽聽聽聽聽 int yl = random.nextInt(12);
聽聽聽聽聽聽聽聽聽 g.drawLine(x,y,x+xl,y+yl);
聽聽}
聽聽
聽聽//鍙栭殢鏈轟駭鐢熺殑璁よ瘉鐮?4浣嶆暟瀛?
聽聽String sRand="";
聽聽for (int i=0;i<4;i++)
聽聽{
聽聽聽聽聽 String rand=String.valueOf(random.nextInt(10));
聽聽聽聽聽 sRand+=rand;
聽聽聽聽聽 // 灝嗚璇佺爜鏄劇ず鍒板浘璞′腑
聽聽聽聽聽 g.setColor(new Color(20+random.nextInt(110),20+random.nextInt(110),20+random.nextInt(110)));//璋冪敤鍑芥暟鍑烘潵鐨勯鑹茬浉鍚岋紝鍙兘鏄洜涓虹瀛愬お鎺ヨ繎錛屾墍浠ュ彧鑳界洿鎺ョ敓鎴?br />聽聽聽聽聽 g.drawString(rand,13*i+6,16);
聽聽}

聽聽//灝嗚璇佺爜瀛樺叆SESSION
聽聽request.getSession().setAttribute("rand",sRand);


聽聽//鍥捐薄鐢熸晥
聽聽g.dispose();

聽聽//杈撳嚭鍥捐薄鍒伴〉闈?br />聽聽ImageIO.write(image, "JPEG", response.getOutputStream());聽聽
聽}

聽//緇欏畾鑼冨洿鑾峰緱闅忔満棰滆壊
聽private Color getRandColor(int fc,int bc)
聽{
聽聽聽聽聽聽聽 Random random = new Random();
聽聽聽聽聽聽聽 if(fc>255) fc=255;
聽聽聽聽聽聽聽 if(bc>255) bc=255;
聽聽聽聽聽聽聽 int r=fc+random.nextInt(bc-fc);
聽聽聽聽聽聽聽 int g=fc+random.nextInt(bc-fc);
聽聽聽聽聽聽聽 int b=fc+random.nextInt(bc-fc);
聽聽聽聽聽聽聽 return new Color(r,g,b);
聽聽聽 }
聽璋冪敤:
聽<td height="25">
聽聽聽聽聽聽聽聽聽聽聽聽<div align="right">
聽聽聽聽聽聽聽聽聽聽聽聽聽<font color="#000000">楠岃瘉鐮侊細</font>
聽聽聽聽聽聽聽聽聽聽聽聽</div>
聽聽聽聽聽聽聽聽聽聽聽</td>
聽聽聽聽聽聽聽聽聽聽聽<td align="left">
聽聽聽聽聽聽聽聽聽聽聽聽<input type="text" name="randCode" size=10></input>
聽聽聽聽聽聽聽聽聽聽聽聽<img style="cursor:hand" name="validatecode"
聽聽聽聽聽聽聽聽聽聽聽聽聽src=" servlet/RadomCodeServlet" height="17" align="middle"
聽聽聽聽聽聽聽聽聽聽聽聽聽onclick="document.validatecode.src=' servlet/RadomCodeServlet'">
聽聽聽聽聽聽聽聽聽聽聽</td>



robbin163 2006-12-08 13:51 鍙戣〃璇勮
]]>
MD5http://www.tkk7.com/zhouzhou163/archive/2006/12/08/86319.htmlrobbin163robbin163Fri, 08 Dec 2006 05:49:00 GMThttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86319.htmlhttp://www.tkk7.com/zhouzhou163/comments/86319.htmlhttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86319.html#Feedback1http://www.tkk7.com/zhouzhou163/comments/commentRss/86319.htmlhttp://www.tkk7.com/zhouzhou163/services/trackbacks/86319.htmlimport java.security.*;


public class MD5
{
聽 private static MD5 md5 = null;
聽 private MD5(){}
聽 public static MD5 getInstance()
聽 {
聽聽聽 if (md5 == null)
聽聽聽 {
聽聽聽聽聽 md5 = new MD5();
聽聽聽 }
聽聽聽 return md5;
聽 }

聽 /**
聽聽 * Description:encrypt the String by "MD5"
聽聽 * @param str String
聽聽 * @return String
聽聽 */
聽 public String calcMD5(String str)
聽 {
聽聽聽 try
聽聽聽 {
聽聽聽聽聽 MessageDigest alga = MessageDigest.getInstance("MD5");
聽聽聽聽聽 alga.update(str.getBytes());
聽聽聽聽聽 byte[] digesta = alga.digest();
聽聽聽聽聽 return byte2hex(digesta);
聽聽聽 }
聽聽聽 catch (Exception e)
聽聽聽 {
聽聽聽聽聽 //System.out.println(e.getMessage());
聽聽聽聽聽 return null;
聽聽聽 }
聽 }

聽 private String byte2hex(byte[] b)
聽 {
聽聽聽 String hs = "";
聽聽聽 String stmp = "";
聽聽聽 for (int n = 0; n < b.length; n++)
聽聽聽 {
聽聽聽聽聽 stmp = (Integer.toHexString(b[n] & 0XFF));
聽聽聽聽聽 if (stmp.length() == 1)
聽聽聽聽聽 {
聽聽聽聽聽聽聽 hs = hs + "0" + stmp;
聽聽聽聽聽 }
聽聽聽聽聽 else
聽聽聽聽聽 {
聽聽聽聽聽聽聽 hs = hs + stmp;
聽聽聽聽聽 }
聽聽聽聽聽 if (n < b.length - 1)
聽聽聽聽聽 {
聽聽聽聽聽聽聽 hs = hs + "";
聽聽聽聽聽 }
聽聽聽 }
聽聽聽 return hs;
聽 }
}



robbin163 2006-12-08 13:49 鍙戣〃璇勮
]]>
cas add filedhttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86317.htmlrobbin163robbin163Fri, 08 Dec 2006 05:48:00 GMThttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86317.htmlhttp://www.tkk7.com/zhouzhou163/comments/86317.htmlhttp://www.tkk7.com/zhouzhou163/archive/2006/12/08/86317.html#Feedback0http://www.tkk7.com/zhouzhou163/comments/commentRss/86317.htmlhttp://www.tkk7.com/zhouzhou163/services/trackbacks/86317.htmlpackage com.jama.credentials;

import org.jasig.cas.authentication.principal.Credentials;

public class LoginInfoCredentials
聽聽聽 implements Credentials
{

聽聽聽 private String account;
聽聽聽 private String password;
聽聽聽 private String randCode;

聽聽聽 public LoginInfoCredentials()
聽聽聽 {
聽聽聽 }

聽聽聽 public String getAccount()
聽聽聽 {
聽聽聽聽聽聽聽 return account;
聽聽聽 }

聽聽聽 public void setAccount(String account)
聽聽聽 {
聽聽聽聽聽聽聽 this.account = account;
聽聽聽 }

聽聽聽 public String getPassword()
聽聽聽 {
聽聽聽聽聽聽聽 return password;
聽聽聽 }

聽聽聽 public void setPassword(String password)
聽聽聽 {
聽聽聽聽聽聽聽 this.password = password;
聽聽聽 }

聽聽聽 public String getRandCode()
聽聽聽 {
聽聽聽聽聽聽聽 return randCode;
聽聽聽 }

聽聽聽 public void setRandCode(String randCode)
聽聽聽 {
聽聽聽聽聽聽聽 this.randCode = randCode;
聽聽聽 }
}


package com.jama.credentials;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jasig.cas.authentication.principal.*;

// Referenced classes of package com.jama.credentials:
//聽聽聽聽聽聽聽聽聽聽聽 LoginInfoCredentials

public class LoginInfoToPrincipalResolver
聽聽聽 implements CredentialsToPrincipalResolver
{

聽聽聽 private final Log log = LogFactory.getLog(getClass());

聽聽聽 public LoginInfoToPrincipalResolver()
聽聽聽 {
聽聽聽 }

聽聽聽 public Principal resolvePrincipal(Credentials credentials)
聽聽聽 {
聽聽聽聽聽聽聽 LoginInfoCredentials loginInfo = (LoginInfoCredentials)credentials;
聽聽聽聽聽聽聽 if(log.isDebugEnabled())
聽聽聽聽聽聽聽 {
聽聽聽聽聽聽聽聽聽聽聽 log.debug((new StringBuilder("Creating SimplePrincipal for [")).append(loginInfo.getAccount()).append("]").toString());
聽聽聽聽聽聽聽 }
聽聽聽聽聽聽聽 return new SimplePrincipal(loginInfo.getAccount());
聽聽聽 }

聽聽聽 public boolean supports(Credentials credentials)
聽聽聽 {
聽聽聽聽聽聽聽 return credentials != null && com/jama/credentials/LoginInfoCredentials.isAssignableFrom(credentials.getClass());
聽聽聽 }
}



robbin163 2006-12-08 13:48 鍙戣〃璇勮
]]>
javascript鍘誨墠鍚庣┖鏍?/title><link>http://www.tkk7.com/zhouzhou163/archive/2006/11/18/81929.html</link><dc:creator>robbin163</dc:creator><author>robbin163</author><pubDate>Sat, 18 Nov 2006 06:35:00 GMT</pubDate><guid>http://www.tkk7.com/zhouzhou163/archive/2006/11/18/81929.html</guid><wfw:comment>http://www.tkk7.com/zhouzhou163/comments/81929.html</wfw:comment><comments>http://www.tkk7.com/zhouzhou163/archive/2006/11/18/81929.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouzhou163/comments/commentRss/81929.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouzhou163/services/trackbacks/81929.html</trackback:ping><description><![CDATA[ <p>function ltrim(str) {<br />聽聽聽聽聽聽聽 var pattern = new RegExp("^[\\s]+","gi");<br />聽聽聽聽聽聽聽 return str.replace(pattern,"");<br />}</p> <p>function rtrim(str) {<br />聽聽聽聽聽聽聽 var pattern = new RegExp("[\\s]+$","gi");<br />聽聽聽聽聽聽聽 return str.replace(pattern,"");<br />}<br />function trim(str) {<br />聽聽聽聽聽聽聽 return rtrim(ltrim(str));<br />} <br /></p> <img src ="http://www.tkk7.com/zhouzhou163/aggbug/81929.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouzhou163/" target="_blank">robbin163</a> 2006-11-18 14:35 <a href="http://www.tkk7.com/zhouzhou163/archive/2006/11/18/81929.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓涓畝鍗曠殑ajaxhttp://www.tkk7.com/zhouzhou163/archive/2006/11/17/81738.htmlrobbin163robbin163Fri, 17 Nov 2006 04:43:00 GMThttp://www.tkk7.com/zhouzhou163/archive/2006/11/17/81738.htmlhttp://www.tkk7.com/zhouzhou163/comments/81738.htmlhttp://www.tkk7.com/zhouzhou163/archive/2006/11/17/81738.html#Feedback0http://www.tkk7.com/zhouzhou163/comments/commentRss/81738.htmlhttp://www.tkk7.com/zhouzhou163/services/trackbacks/81738.htmlindex.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script language="javascript">
function detect(){
聽 xml=new ActiveXObject("Microsoft.XMLHTTP");
聽 var post="";
聽 xml.open("POST","http://localhost:8080/xmlhttp.jsp",false);
聽 xml.setrequestheader("content-length" ,post.length);
聽 xml.setrequestheader("content-type" , "application/x-www-form-urlencoded" );
聽 xml.send(post);
聽 var res=xml.responseText;
聽 list.innerText=res;
聽 setTimeout("detect()",1000);
}
</script>

<body onload = "detect()">
test :
聽聽聽聽 <a id="list" >聽 </a>

</BODY>
</HTML>


xmlhttp.jsp
<%@ page language="java" contentType="text/html;charset=GB2312"%>
<%@ page import ="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<%
聽 Random randor=new Random();
聽 out.println(randor.nextInt());
%>
</BODY>
</HTML>



robbin163 2006-11-17 12:43 鍙戣〃璇勮
]]>
jasperreport鐢熸垚html,Excel,PDF鎶ヨ〃錛屾暟鎹簮浣跨敤Listhttp://www.tkk7.com/zhouzhou163/archive/2006/11/12/80760.htmlrobbin163robbin163Sun, 12 Nov 2006 14:21:00 GMThttp://www.tkk7.com/zhouzhou163/archive/2006/11/12/80760.htmlhttp://www.tkk7.com/zhouzhou163/comments/80760.htmlhttp://www.tkk7.com/zhouzhou163/archive/2006/11/12/80760.html#Feedback6http://www.tkk7.com/zhouzhou163/comments/commentRss/80760.htmlhttp://www.tkk7.com/zhouzhou163/services/trackbacks/80760.htmljasperreport涓彲浠ヤ嬌鐢↙ist浣滀負鏁版嵁婧愶紝浣跨敤鏍煎紡濡備笅.
List list=this.customerDao.getAllCustomer();聽 //寰楀埌鎵鏈夊鎴?br />JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
聽聽聽JasperPrint jasperPrint = JasperFillManager.fillReport(
聽聽聽聽聽reportFilePath, parameters, ds);
寰楀~鍏呮暟鎹悗錛屽嵆鍙緭鍑烘樉紺哄埌PDF,Excel,Html
鍒癙DF:
public byte[] generatePDF(String begCustNo, String endCustNo,
聽聽聽String reportTitle, String reportFilePath) throws DemoException {
聽聽// TODO Auto-generated method stub
聽//begCustNo,endCustNo鍒嗗埆涓烘煡璇紶鍏ョ殑寮濮嬬紪鍙鳳紝緇撴潫緙栧彿.
聽聽jdbcCustomerDao = new JdbcCustomerDao();
聽聽Map parameters = new HashMap();
聽聽parameters.put("ReportTitle", reportTitle);//鎶ヨ〃鏍囬
聽聽List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
聽聽聽try {
聽聽聽JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
聽聽聽JasperPrint jasperPrint = JasperFillManager.fillReport(
聽聽聽聽聽reportFilePath, parameters, ds);聽聽聽return JasperExportManager.exportReportToPdf(jasperPrint);
聽聽} catch (JRException e) {
聽聽聽throw new DemoException("Report Export Failed.");
聽聽}
聽}
鍒癏tml:
public byte[] generateHtml(String begCustNo, String endCustNo,
聽聽聽String reportTitle, String reportFilePath) throws DemoException {
聽聽jdbcCustomerDao = new JdbcCustomerDao();
聽聽Map parameters = new HashMap();
聽聽parameters.put("ReportTitle", reportTitle);
聽聽List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
聽聽System.out.println("list size is :" + list.size());
聽聽JRHtmlExporter exporter = new JRHtmlExporter();
聽聽ByteArrayOutputStream oStream = new ByteArrayOutputStream();
聽聽try {
聽聽聽JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
聽聽聽JasperPrint jasperPrint = JasperFillManager.fillReport(
聽聽聽聽聽reportFilePath, parameters, ds);
聽聽聽exporter.setParameter(
聽聽聽聽聽JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,
聽聽聽聽聽Boolean.FALSE);
聽聽聽exporter
聽聽聽聽聽.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
聽聽聽exporter
聽聽聽聽聽.setParameter(JRExporterParameter.CHARACTER_ENCODING, "GBK");
聽聽聽exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, oStream);
聽聽聽exporter.exportReport();
聽聽聽byte[] bytes = oStream.toByteArray();
聽聽聽return bytes;
聽聽} catch (JRException e) {
聽聽聽throw new DemoException("Report Export Failed.");
聽聽}
聽}
鍒癊xcel:
public byte[] generateExcel(String begCustNo, String endCustNo,
聽聽聽String reportTitle, String reportFilePath) throws DemoException {
聽聽jdbcCustomerDao = new JdbcCustomerDao();
聽聽Map parameters = new HashMap();
聽聽parameters.put("ReportTitle", reportTitle);
聽聽List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
聽聽System.out.println("list size is :" + list.size());
聽聽JRXlsExporter exporter = new JRXlsExporter(); // Excel
聽聽ByteArrayOutputStream oStream = new ByteArrayOutputStream();
聽聽try {
聽聽聽JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
聽聽聽JasperPrint jasperPrint = JasperFillManager.fillReport(
聽聽聽聽聽reportFilePath, parameters, ds);
聽聽聽exporter
聽聽聽聽聽.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
聽聽聽exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, oStream);
聽聽聽exporter.setParameter(
聽聽聽聽聽JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
聽聽聽聽聽Boolean.TRUE);
聽聽聽exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,
聽聽聽聽聽Boolean.FALSE);
聽聽聽exporter.setParameter(
聽聽聽聽聽JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND,
聽聽聽聽聽Boolean.FALSE);
聽聽聽exporter.exportReport();
聽聽聽byte[] bytes = oStream.toByteArray();
聽聽聽return bytes;

聽聽} catch (JRException e) {
聽聽聽throw new DemoException("Report Export Failed.");
聽聽}
聽}

jsp璋冪敤鏂規硶錛?br />聽<%
聽聽聽聽
聽聽聽
聽String filePath=getServletContext().getRealPath("/")+"report.jasper";聽

聽CustomerServiceImpl聽 custs=new CustomerServiceImpl();
聽聽聽 byte[] bytes=null;
聽 String begNo=request.getParameter("beginCustNo");
聽 String endNo=request.getParameter("endCustNo");
聽 String type=request.getParameter("type");

聽 if(type.equals("Pdf")){聽
聽聽聽聽聽 bytes=聽custs.generatePDF(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);
聽 }else if(type.equals("Excel")){
聽聽 bytes=custs.generateExcel(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);
聽 }else
聽聽聽聽 bytes=custs.generateHtml(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);


聽if(bytes!=null){
聽聽if(type.equals("Pdf")){
聽聽聽聽聽聽聽 聽response.setContentType("application/pdf");
聽聽}else if(type.equals("Excel")){
聽聽聽聽 response.setContentType("application/vnd.ms-excel");
聽聽}else
聽聽聽response.setContentType("text/html");
聽聽聽 response.setContentLength(bytes.length);
聽聽聽 ServletOutputStream ouputStream = response.getOutputStream();
聽聽聽 ouputStream.write(bytes,0,bytes.length);
聽聽聽 ouputStream.flush();
聽聽聽 ouputStream.close();
聽}else
聽{
聽聽out.println("error");
聽}

聽 %>



robbin163 2006-11-12 22:21 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲理论精品午夜电影| 成全视频高清免费观看电视剧| 亚洲欧洲成人精品香蕉网| 免费电视剧在线观看| 久久免费精品视频| 日日狠狠久久偷偷色综合免费 | 亚洲精品国产av成拍色拍| 亚洲国产精品线在线观看| 亚洲天堂免费在线视频| 日本高清免费aaaaa大片视频| 最近最好最新2019中文字幕免费| 一本久久A久久免费精品不卡| 亚洲国产成人精品无码区花野真一 | 蜜臀91精品国产免费观看| 国产h肉在线视频免费观看| 久久狠狠躁免费观看| 久久久久女教师免费一区| 欧亚一级毛片免费看| 亚洲AV无码AV男人的天堂不卡 | 91精品免费久久久久久久久| 一级特黄录像免费播放肥| 污污视频网站免费观看| 蜜芽亚洲av无码一区二区三区| 亚洲高清一区二区三区| 亚洲免费观看在线视频| 亚洲视频免费观看| 亚洲福利一区二区精品秒拍| 亚洲AV无码一区东京热| 国产精品久久久亚洲| 久久亚洲精品视频| 亚洲av无码潮喷在线观看| 国产亚洲精品a在线观看app| 亚洲午夜久久久久久久久电影网| 亚洲AV无码一区二区三区国产| 免费国产综合视频在线看| 日韩亚洲国产二区| 国产亚洲精品a在线观看| 国产亚洲自拍一区| 亚洲成A∨人片在线观看不卡 | 久久免费精品一区二区| 少妇人妻偷人精品免费视频|