锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲综合色自拍一区,国产乱子伦精品,久久成人资源http://www.aygfsteel.com/wangzhouyu/category/14906.htmlzh-cnThu, 30 Jun 2011 18:13:01 GMTThu, 30 Jun 2011 18:13:01 GMT60mavn涔辯爜http://www.aygfsteel.com/wangzhouyu/archive/2011/06/30/353403.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Wed, 29 Jun 2011 18:15:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2011/06/30/353403.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/353403.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2011/06/30/353403.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/353403.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/353403.html1.緙栬瘧涔辯爜錛岃緗紪璇戠殑瀛楃闆嗙紪鐮佸拰鐜緙栫爜
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.4</source>
                    <target>1.4</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
璁劇疆鐜鍙橀噺MAVEN_OPTS=-Xms64m -Xmx128m -Dfile.encoding=UTF-8
2.榪愯mvn test鏃朵貢鐮侊紙IDE涓婅繍琛孴estCase鏃禣K錛屼絾鏄繍琛宮aven test涔辯爜,緇撴灉嫻嬭瘯涓嶉氳繃錛変慨鏀筽om.xml澧炲姞濡備笅鍐呭鍗沖彲
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7.2</version>
                <configuration>
                    <forkMode>once</forkMode>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <systemProperties>
                        <property>
                            <name>net.sourceforge.cobertura.datafile</name>
                            <value>target/cobertura/cobertura.ser</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>

]]>
Tomcat鐨刄RIEncodinghttp://www.aygfsteel.com/wangzhouyu/archive/2007/04/26/113705.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Thu, 26 Apr 2007 02:33:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2007/04/26/113705.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/113705.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2007/04/26/113705.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/113705.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/113705.html瀵﹂殯閬嬬敤 Tomcat 5.0.19錛屾垜鍊戜簡瑙e湪涓嶄慨鏀?Tomcat 鍘熷紕肩殑鐙娉佷笅錛屼嬌鐢ㄨ呴忛亷 Form submit 鐨勮硣鏂欏皣涓寰嬩互 ISO8859-1 铏曠悊錛岀▼寮忚ō璦堝斧蹇呴爤鑷灝囧瓧涓插皣杞夋彌鐐?Big5(綣侀珨涓枃) or GB2312/GBK(綈¢珨涓枃)錛屾垜鍊戝湪鎳夌敤紼嬪紡涓紝灝嶆墍鏈夌殑 request.getParameter("xx"); 浣滀簡 toBig5String() 鐨勮檿鐞嗭紝鐞嗚珫涓婏紝鎵鏈夌殑涓枃鍟忛鎳夎┎涓嶆渻鍑虹従鎵嶅皪錛岀祼鏋滐紝閭勬槸鐧肩従鏌愪簺鐙娉佷笅錛屼腑鏂囬倓鏄畩鎴愪簜紕鹼紒

綞撻亷鍒嗘瀽鏁寸悊錛屾垜鍊戠櫦鐝懼晱欏屽嚭鍦?QueryString 鐨勮В鏋愶紝浠ュ墠鍦?Tomcat 4.x 鏅備唬錛岀劇璜?SUBMIT 鏅傛帯鐢?GET or POST錛孴omcat server 灝?parameters 鐨勮檿鐞嗛兘鎺$敤鐩稿悓鐨勭法紕鹼紝浣嗗湪 Tomcat 5.x 鐗堬紝涓嶇煡浣曟晠錛屽嵒灝?QueryString 鐨勮В鏋愮崹绔嬪嚭渚嗭紝鐩墠紕鴻獚錛孎orm 鐨?Method 鎺$敤 GET 鍙婄洿鎺ュ皣鍙冩暩瀵湪 URL 涓婄殑涓枃錛屼笂鍌沖埌 Tomcat 鏅傦紝鐒¤珫濡備綍杞夌⒓錛岄兘鏈冭畩鎴愪簜紕鹼紝閭f曚綘浜嬪厛浣滈亷 URLEncode 涔熶竴妯c?br/>
綞茬珯涓婏紝鏈変漢閲濆皪閫欏嬪晱欏岋紝寤鴻灝囨墍鏈変腑鏂囨敼鎺$敤 base64 綬ㄧ⒓錛屽埌浜?server 涓婏紝紼嬪紡灝囪嚜琛屽湡 base64 decode 鍥炰締錛岀⒑淇濅腑鏂囦笉鏈冪櫦鐢熷晱欏屻傞欐ǎ浣滄硶鐣剁劧鍙互瑙f焙閫欏嬪晱欏岋紝浣嗘槸鎵鏈夌恫闋佽畩鎴愰檺瀹氳鎺$敤 POST錛屼笖紼嬪紡璦▓甯闅ㄦ檪鍒嗘竻妤氾紝閭e嬪弮鏁告槸鎺$敤 GET 涓婂偝錛岄偅鍊嬪弮鏁告槸鎺$敤 POST 涓婂偝錛岀劧寰屽啀閲濆皪涓嶅悓鐨勬柟寮忔帯鐢ㄤ笉鍚岀殑瑙f瀽錛岄欐ǎ鐨勭▼寮忎竴榛炲厭縐繪鎬ч兘娌掓湁錛屾洿鍒ユ彁璺ㄥ鉤鍙般佽法鍦嬮殯瑾炶█浜嗐?br/>
鐮旂┒ Tomcat 鐨勬枃浠跺強鍘熷紕鹼紝鎴戝戞壘鍒頒簡鍟忛鎵鍦ㄥ強瑙f焙鐨勬柟娉曪紝鍙湁鎸夎憲浠ヤ笅鐨勪綔娉曪紝鎵嶈兘浣?Form submit 鐨勮硣鏂欏畬鍏ㄦ寜钁?ISO8859-1 鐨勭法紕鹼紝鐣剁劧錛岃嫢鏄叏鐓ц憲 Tomcat 鐨勬枃浠惰鏄庡幓浣滐紝鑲畾閭勬槸涓嶈錛屼綘閭勬槸寰楀姞涓婇欏嬪弮鏁稿埌 server.xml 涓墠琛屻?br/>
瑙f焙鏂規

璜嬪厛鐮旂┒ $TOMCAT_HOME/webapps/tomcat-docs/config/http.html 閫欏嬭鏄庢獢錛屾摲閷勯噸榛炲涓嬶細
URIEncoding錛歍his specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used.

useBodyEncodingForURI錛歍his specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x, where the encoding specified in the contentType, or explicitely set using Request.setCharacterEncoding method was also used for the parameters from the URL. The default value is false.

涓婅堪浜屽?Tomcat 鍙冩暩錛屾槸璦畾鍦?server.xml 涓殑 http <Connector /> 鍗濉婏紝瑕佽В姹?QueryString 涓枃璁婃垚浜傜⒓鐨勫晱欏岋紝浣犲繀闋堣嚦灝戣ō瀹氶欎簩鍊嬪弮鏁稿叾涓箣涓銆?br/>URIEncoding 璜嬭ō瀹氱偤 URIEncoding="ISO-8859-1" 鎸囧畾鐐?"ISO-8859-1" 綬ㄧ⒓錛岃畵 QueryString 鐨勫瓧鍏冪法紕艱垏 post body 鐩稿悓銆?br/>useBodyEncodingForURI 閫欐槸鐢ㄤ締鐩稿 Tomcat 4.x 鐗堢殑錛岃ō瀹氱殑鍊兼槸 "true" or "false"錛屾剰鎬濇槸鎸?"瑕佷笉瑕佽畵 QueryString 鑸?POST BODY 鎺$敤鐩稿悓鐨勫瓧鍏冪法紕??"錛岃嫢鏄ō鎴?true錛岄偅涔熷彲閬斿埌 "ISO-8859-1" 綬ㄧ⒓鐨勯渶姹傘?br/>寤鴻錛屾帯鐢?URIEncoding 鐨勮ō瀹氾紝鐣㈢珶 useBodyEncodingForURI 鐨勪綔娉曟槸鐐轟簡鐩稿 Tomcat 4.X銆備笉閬庤嫢鐓у師鏂囩殑瑾槑錛岀悊璜栦笂閫欎簩鍊嬪弮鏁擱兘涓嶈ō錛孴omcat 涔熻┎鎺$敤 "ISO-8859-1" 鐨勭法紕鹼紝閭g偤浠楹奸倓鏄渻鏈夊晱欏屽憿 ? 鎴戝戠敱 Tomcat Source Code 渚嗙湅灝辨竻妤氫簡銆?br/>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 閫欎竴孌電⒓鏄?Tomcat 鐢ㄤ締瑙?QueryString 鐨勭▼寮忥紝
// 鍦?org.apache.tomcat.util.http.Parameters 閫欏?class 瑁°?private String urlDecode(ByteChunk bc, String enc)
  throws IOException {
  if( urlDec==null ) {
     urlDec=new UDecoder(); 
  }
  urlDec.convert(bc);
  String result = null;
  if (enc != null) {
    bc.setEncoding(enc);
    result = bc.toString();
  } 
  else {
    CharChunk cc = tmpNameC;
    cc.allocate(bc.getLength(), -1);
    // Default encoding: fast conversion
    byte[] bbuf = bc.getBuffer();
    char[] cbuf = cc.getBuffer();
    int start = bc.getStart();
    for (int i = 0; i < bc.getLength(); i++) {
      cbuf[i] = (char) (bbuf[i + start] & 0xff);
    }
    cc.setChars(cbuf, 0, bc.getLength());
    result = cc.toString();
    cc.recycle();
  }
  return result;
}

璜嬬壒鍒ユ敞鎰忕磪鑹插崁濉婏紝鐣?Tomcat 鐧肩従 QueryString 涓︽矑鏈夎ō瀹?encode 鏅傦紝涓﹂潪鍍忔枃浠朵腑鎵瑾爯璦帯鐢?ISO-8859-1 鐨勭法紕鹼紝鑰屾槸鐢ㄤ竴孌?fast conversion 渚嗚檿鐞嗭紝鎵嶆渻閫犳垚涓枃鍟忛錛屾墍浠ワ紝閭勬槸蹇呴爤鍦?Server.xml 涓紝鍔犱笂 URLEncoding 鐨勫弮鏁歌ō瀹氭墠琛屽摝銆?br/>
Connector 鐨勮ō瀹氱瘎渚嬶細
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<Connector
debug="0"
acceptCount="100"
connectionTimeout="20000"
disableUploadTimeout="true"
port="80"
redirectPort="8443"
enableLookups="false"
minSpareThreads="25"
maxSpareThreads="75"
maxThreads="150"
maxPostSize="0"
URIEncoding="ISO-8859-1"
>
</Connector>

鏂囩珷鏉ヨ嚦錛?a >http://www.javaworld.com.tw/jute/post/view?bid=9&id=44042&sty=1&tpg=1&age=0

]]>
IntelliJ IDEA 7.0M1鍙戝竷浜?/title><link>http://www.aygfsteel.com/wangzhouyu/archive/2007/04/12/110057.html</link><dc:creator>灝忓皬~鍜栧暋璞?/dc:creator><author>灝忓皬~鍜栧暋璞?/author><pubDate>Thu, 12 Apr 2007 01:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangzhouyu/archive/2007/04/12/110057.html</guid><wfw:comment>http://www.aygfsteel.com/wangzhouyu/comments/110057.html</wfw:comment><comments>http://www.aygfsteel.com/wangzhouyu/archive/2007/04/12/110057.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangzhouyu/comments/commentRss/110057.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangzhouyu/services/trackbacks/110057.html</trackback:ping><description><![CDATA[ <p>緇濆鐨勬渶寮虹殑java ide鐨?.0M1宸茬粡鍑轟簡錛屽揩鍘昏瘯璇曟妸錛?br/><a >http://www.jetbrains.com/idea/nextversion/</a><br/></p> <img src ="http://www.aygfsteel.com/wangzhouyu/aggbug/110057.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangzhouyu/" target="_blank">灝忓皬~鍜栧暋璞?/a> 2007-04-12 09:07 <a href="http://www.aygfsteel.com/wangzhouyu/archive/2007/04/12/110057.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>idea6.0鎻愰珮閫熷害鐨勮緗?/title><link>http://www.aygfsteel.com/wangzhouyu/archive/2007/03/11/103063.html</link><dc:creator>灝忓皬~鍜栧暋璞?/dc:creator><author>灝忓皬~鍜栧暋璞?/author><pubDate>Sat, 10 Mar 2007 16:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangzhouyu/archive/2007/03/11/103063.html</guid><wfw:comment>http://www.aygfsteel.com/wangzhouyu/comments/103063.html</wfw:comment><comments>http://www.aygfsteel.com/wangzhouyu/archive/2007/03/11/103063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangzhouyu/comments/commentRss/103063.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangzhouyu/services/trackbacks/103063.html</trackback:ping><description><![CDATA[ <p><a >http://www.scriptviewer.com/story.php?title=IntelliJ-IDEA-60-aeae</a></p> <img src ="http://www.aygfsteel.com/wangzhouyu/aggbug/103063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangzhouyu/" target="_blank">灝忓皬~鍜栧暋璞?/a> 2007-03-11 00:43 <a href="http://www.aygfsteel.com/wangzhouyu/archive/2007/03/11/103063.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁﹊dea6.0鐢ㄤ笂jdk6http://www.aygfsteel.com/wangzhouyu/archive/2007/02/01/97134.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Thu, 01 Feb 2007 00:09:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2007/02/01/97134.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/97134.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2007/02/01/97134.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/97134.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/97134.htmlIdea6.0榛樿鏄敤鐨勮嚜甯︾殑jdk5鍚姩鐨勶紝濡傛灉鎯崇敤jdk6鍙互鎸夊涓嬪姙娉曟搷浣滐細


1.灝唅dea鐩綍涓嬬殑jre鐩綍鏀瑰悕
2.灝嗗畨瑁卝dk6鐩綍涓殑jre鐩綍鎷瘋礉鍒癷dea鐩綍涓嬶紝鐒跺悗鍦ㄥ皢jdk6鐩綍涓殑jdk\lib\tools.jar鎷瘋礉鍒癹re\lib涓?br/>3.淇敼idea.exe.vmoptions鏂囦歡涓殑鍚姩鍙傛暟錛堣繖涓笉鏄繀欏葷殑錛屽彧鏄彁楂榠dea鐨勫搷搴旈熷害錛?

]]>
jdk寮婧愬彂甯冧簡http://www.aygfsteel.com/wangzhouyu/archive/2006/11/14/81036.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Tue, 14 Nov 2006 00:08:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2006/11/14/81036.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/81036.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2006/11/14/81036.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/81036.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/81036.htmlJDK鐨勫紑婧愬凡緇忓彂甯冧簡
https://openjdk.dev.java.net/



]]>
Common Mail涔辯爜闂http://www.aygfsteel.com/wangzhouyu/archive/2006/09/18/70222.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Mon, 18 Sep 2006 01:54:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/18/70222.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/70222.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/18/70222.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/70222.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/70222.htmlcommon mail鏄竴涓皬鑰屾柟渚跨殑mail鍖咃紝浠栧疄鐜頒簡瀵笿ava Mail鐨勫皝瑁咃紝浣跨敤璧鋒潵鍗佸垎鐨勬柟渚匡紝浣嗘槸鎴戝湪浣跨敤浠栫殑鏃跺欏彂鐜幫紝浣跨敤綰枃鏈殑鍐呭鍙戦侊紝緇撴灉鏄貢鐮侊紝浠g爜濡備笅錛?br/>public class TestCommonMail {
public static void main(String[] args) throws EmailException, MessagingException {
SimpleEmail email = new SimpleEmail();
email.setCharset("GB2312");
email.setHostName("smtp.163.com");
email.setSubject("test");
email.addTo("test@163.com");
email.setFrom("test@163.com");
email.setMsg("鎴戠殑嫻嬭瘯");
email.setAuthentication("test", "test");
email.send();
}
}

鍒嗘瀽浜嗕竴涓媍ommons mail鐨勬簮鐮佹壘鍒頒簡鍘熷洜銆傛簮鐮佸涓?
public class SimpleEmail extends Email
{
public Email setMsg(String msg) throws EmailException, MessagingException
{
if (EmailUtils.isEmpty(msg))
{
throw new EmailException("Invalid message supplied");
}

setContent(msg, TEXT_PLAIN);
return this;
}
}

Email浠g爜鐗囨
public void setContent(Object aObject, String aContentType)
{
this.content = aObject;
if (EmailUtils.isEmpty(aContentType))
{
this.contentType = null;
}
else
{
// set the content type
this.contentType = aContentType;

// set the charset if the input was properly formed
String strMarker = "; charset=";
int charsetPos = aContentType.toLowerCase().indexOf(strMarker);
if (charsetPos != -1)
{
// find the next space (after the marker)
charsetPos += strMarker.length();
int intCharsetEnd =
aContentType.toLowerCase().indexOf(" ", charsetPos);

if (intCharsetEnd != -1)
{
this.charset =
aContentType.substring(charsetPos, intCharsetEnd);
}
else
{
this.charset = aContentType.substring(charsetPos);
}
}
}
}

email.send();鐨剆end鏂規硶灝嗚皟鐢?br/>public void buildMimeMessage() throws EmailException
{
try
{
this.getMailSession();
this.message = new MimeMessage(this.session);

if (EmailUtils.isNotEmpty(this.subject))
{
if (EmailUtils.isNotEmpty(this.charset))
{
this.message.setSubject(this.subject, this.charset);
}
else
{
this.message.setSubject(this.subject);
}
}

// ========================================================
// Start of replacement code
if (this.content != null)
{
this.message.setContent(this.content, this.contentType);
}
// end of replacement code
// ========================================================
else if (this.emailBody != null)
{
this.message.setContent(this.emailBody);
}
else
{
this.message.setContent("", Email.TEXT_PLAIN);
}

if (this.fromAddress != null)
{
this.message.setFrom(this.fromAddress);
}
else
{
throw new EmailException("Sender address required");
}

if (this.toList.size() + this.ccList.size() + this.bccList.size() == 0)
{
throw new EmailException(
"At least one receiver address required");
}

if (this.toList.size() > 0)
{
this.message.setRecipients(
Message.RecipientType.TO,
this.toInternetAddressArray(this.toList));
}

if (this.ccList.size() > 0)
{
this.message.setRecipients(
Message.RecipientType.CC,
this.toInternetAddressArray(this.ccList));
}

if (this.bccList.size() > 0)
{
this.message.setRecipients(
Message.RecipientType.BCC,
this.toInternetAddressArray(this.bccList));
}

if (this.replyList.size() > 0)
{
this.message.setReplyTo(
this.toInternetAddressArray(this.replyList));
}

if (this.headers.size() > 0)
{
Iterator iterHeaderKeys = this.headers.keySet().iterator();
while (iterHeaderKeys.hasNext())
{
String name = (String) iterHeaderKeys.next();
String value = (String) headers.get(name);
this.message.addHeader(name, value);
}
}

if (this.message.getSentDate() == null)
{
this.message.setSentDate(getSentDate());
}

if (this.popBeforeSmtp)
{
Store store = session.getStore("pop3");
store.connect(this.popHost, this.popUsername, this.popPassword);
}
}
catch (MessagingException me)
{
throw new EmailException(me);
}
}
鐢變唬鐮佸彲浠ョ煡閬撶函鏂囨湰鏂瑰紡鏈緇堣皟鐢ㄤ簡Java Mail鐨?br/>message.setContent(this.content, this.contentType);
content鏄唴瀹?br/>contentType鏄被鍨嬶紝濡倀ext/plain,
(鎴戜滑鍙互璇曡瘯鐩存帴鐢↗ava mail鍙戦偖浠訛紝璁劇疆鏂囨湰鍐呭涓嶄嬌鐢╯etText鏂規硶錛屼篃浣跨敤setContent("嫻嬭瘯", "text/plain")鏂瑰紡錛屼綘鍙互鐪嬪埌鍐呭涔熸槸涔辯爜)
鍏抽敭灝卞湪浜巘ext/plain錛屾垜浠敼鎴恡ext/plain;charset=gb2312錛宱k涔辯爜瑙e喅浜嗐傚湪commons mail鎴戜滑鐪婼impleEmail 綾諱腑setMsg鏂規硶璋冪敤鐨勫氨鏄?setContent(msg, TEXT_PLAIN);鎴戜滑鍙渶瑕佸皢Email綾諱腑鐨勫父閲廡EXT_PLAIN淇敼涓涓嬪姞鍏?charset=浣犵殑瀛楃闆?錛岄噸鏂版墦鍖卝ar錛岃繖鏍峰氨鍙互浜?br/>



]]>
涓涓畝鍗曠殑鍙戦侀偖浠剁殑渚嬪瓙http://www.aygfsteel.com/wangzhouyu/archive/2006/09/15/69821.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Fri, 15 Sep 2006 02:30:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/15/69821.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/69821.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/15/69821.html#Feedback1http://www.aygfsteel.com/wangzhouyu/comments/commentRss/69821.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/69821.htmlpackage org.wzywjy.mail;

import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class TestMail {

public final static String SMTPSERVER = "smtp.163.com";
public final static String POPSERVER = "pop.163.com";
public final static String ACCOUNT = "test";
public final static String PWD = "test";
public final static String MAILADDR = "test@163.com";

public void sendMail(String to, String from, String subject, String body) throws AddressException, MessagingException {
Properties pro = System.getProperties();
pro.put("mail.smtp.host", SMTPSERVER);
pro.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(pro, null);

Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipient(Message.RecipientType.TO, InternetAddress.parse(to, false)[0]);
msg.setSubject(subject);
msg.setText(body);
msg.setHeader("X-Mailer", "LOTONtechEmail");
msg.setSentDate(new Date());

Transport transport = session.getTransport("smtp");
System.out.println("connecting...");
transport.connect(SMTPSERVER, ACCOUNT, PWD);
System.out.println("Sending message");
transport.sendMessage(msg, msg.getAllRecipients());
transport.close();
}

public static void main(String[] args) {
TestMail test = new TestMail();
try {
test.sendMail(MAILADDR, MAILADDR, "test", "鎴戠殑涓涓祴璇?);
} catch (AddressException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}
}
}



]]>
鐢‥clipse鍜孞Boss IDE寮鍙慦ebServicehttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/06/67934.html灝忓皬~鍜栧暋璞?/dc:creator>灝忓皬~鍜栧暋璞?/author>Wed, 06 Sep 2006 00:24:00 GMThttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/06/67934.htmlhttp://www.aygfsteel.com/wangzhouyu/comments/67934.htmlhttp://www.aygfsteel.com/wangzhouyu/archive/2006/09/06/67934.html#Feedback0http://www.aygfsteel.com/wangzhouyu/comments/commentRss/67934.htmlhttp://www.aygfsteel.com/wangzhouyu/services/trackbacks/67934.html娉細榪欐槸鎴戝湪緗戜笂鎵懼埌鐨勪竴綃囨枃绔狅紝鎴戞寜鏂囩珷鐨勬楠ゆ搷浣滐紝榪樻槸鏈変笉灝戦棶棰橈紝鍦ㄦ鎴戣繘琛屼簡淇敼. 鍘熸潵鏂囩珷鍦板潃 http://www.java-asp.net/java/200601/t_56635.html


鐢╡clipse+xdoclet+axis寮鍙慦ebService

鍦╡clipse涓嬪紑鍙戝熀浜巃xis鐨刉ebService鍏跺疄寰堢畝鍗曪紝浣嗕篃鏈変笉灝戞楠わ紝浠ヤ笅瀵規瘡涓楠よ繘琛岃鏄?/p>

/**
*
* @author honghao
* @axis.service scope = "Request" urn = "TestService"
*/
public class TestService {
/**
* @param name
* @axis.method
*/
public String test(String name){
return "hello " + name;
}
}

鍏朵腑@axis.service琛ㄧずTestService浣滀負鏈嶅姟綾伙紝@axis.method琛ㄧず杈撳嚭test()鏂規硶浣滀負WebService

4) 閰嶇疆xdoclet
鎵撳紑project->properties錛屽湪XDoclet Configurations涓坊鍔犱竴涓柊鐨勯厤緗紝鍙互浠繪剰鍙栧悕錛屾澶勪負"webservice"錛屽湪榪欎釜閰嶇疆涓坊鍔爀jbdoclet,鍦ㄥ叾涓啀娣誨姞fileset鐢ㄤ簬鎸囧畾瀵瑰摢浜涙枃浠舵墽琛寈doclet(瑕佹寚鏄庢枃浠剁殑璺緞)錛屽拰axisdeploy錛宎xisdeploy涓嶇敤榪涜浠諱綍璁劇疆銆傚湪ejbdoclet涓渶瑕佹寚瀹歞estdir鐢熺敤浜庢寚紺虹敓鎴愮殑鏂囦歡鎵鍦ㄧ殑璺緞銆?/span>

5) 榪愯xdoclet.鍙沖嚮欏圭洰宸ョ▼錛屾墽琛孯un Xdoclet鑿滃崟錛屽鏋滈厤緗病鏈夐敊璇殑璇濓紝搴旇鍦ㄧ洰鏍囪礬寰勪笅鐢熸垚deploy-TestService.xml,榪欐槸涓涓猘xis鐢ㄤ簬鐢熸垚server-config.wsdd鏂囦歡鐨勯儴緗叉枃浠躲?br/>榪欓噷闇瑕佹敞鎰忕殑鏄紝濡傛灉綾繪枃浠舵槸鏀懼湪鏌愪釜鍖呬笅鐨勬椂鍊欙紝鎴戞棤娉曠敓鎴?/span>deploy-TestService.xml鏂囦歡錛屼絾鏄皢綾繪枃浠舵斁鍦ㄦ牴璺緞涓嬪氨鍙互鐢熸垚浜嗭紝鍘熷洜涓嶅悕.

6) 鐢熸垚server-config.wsdd閮ㄧ講鏂囦歡.榪欎釜鏂囦歡鍏跺疄鏄敱axis鐨勪竴涓伐鍏風敓鎴愮殑錛屼絾鏄洿鎺ヨ繍琛岃繖涓伐鍏峰お楹葷儲錛屾墍浠ユ垜浠繕闇瑕佺敓鎴愪竴涓猘nt鏋勫緩鏂囦歡錛屼嬌鍏惰兘鑷姩鐢熸垚錛?br/>鍦╳eb欏圭洰鐨勬牴璺緞涓嬫柊寤篵uild.xml錛岃緭鍏ヤ互涓嬫枃鏈細
<?xml version="1.0" encoding="UTF-8"?>
<property name="axis_lib_path" value="${axis.lib}"/>
<property name="wsdl.dir" location="wsdl" />
<path id="axis.lib.path">
<fileset dir="${axis_lib_path}">
<include name="*.jar" />
</fileset>
</path>
<path id="project.classpath">
<pathelement location="wsdl"/>
</path>
<target name="deploy">
<java classname="org.apache.axis.utils.Admin" fork="true" dir="WEB-INF"> <!--dir瀵瑰簲鐢熸垚鏂囦歡鐨勪綅緗?->
<classpath refid="axis.lib.path" />
<arg value="server" />
<arg value="${wsdl.dir}/deploy-TestHandler.xml" /> <!--TestHandler瀵瑰簲涓婇潰鐨剎ml鏂囦歡鍚峊estService-->
</java>
</target>
</project>
娉ㄦ剰錛歸sdl鏄垰鎵嶇敓鎴愮殑deploy-TestService.xml鎵鍦ㄧ殑鐩綍,org.apache.axis.utils.Admin鏄痑xis鎻愪緵鐨勫伐鍏風被錛屽叾浠栬礬寰勮緗鏍規嵁瀹為檯欏圭洰榪涜閫傚綋璋冩暣銆?br/>淇濆瓨鍚庯紝鍙沖嚮build.xml鎵цRun->Ant 鏋勫緩錛屽鏋滈厤緗紜紝鍒欎細鍦╓EB-INF鐩綍涓嬬敓鎴恠erver-config.wsdd鏂囦歡
榪樻湁ant緙栬瘧鐨勬椂鍊欓渶瑕乤xis鐨刲ib銆?br/>
7) 浠塊燼xis鎻愪緵鐨剆ample宸ョ▼鍦╰omcat涓繘琛岄儴緗詫紝鍦ㄦ祻瑙堝櫒涓緭鍏?br/>http://localhost:8080/axis/services
浼氬垪鍑烘墍鏈夌殑WebService
杈撳叆http://localhost:8080/axis/services/TestService?wsdl
浼氳緭鍑虹浉搴旂殑wsdl鍐呭
鐒跺悗灝卞彲浠ョ敤鐩稿簲鐨勫伐鍏瘋繘琛屾祴璇曚簡銆?br/>



]]>
主站蜘蛛池模板: 安化县| 清水县| 西平县| 太白县| 浏阳市| 孝昌县| 无棣县| 曲周县| 稷山县| 黔西| 湘乡市| 武川县| 南部县| 桦川县| 尉氏县| 鸡东县| 尼勒克县| 汤原县| 南汇区| 平度市| 方城县| 平江县| 长寿区| 泸西县| 花莲县| 汉源县| 玉门市| 安顺市| 息烽县| 新昌县| 乌拉特后旗| 子洲县| 方城县| 兴安盟| 镇沅| 马龙县| 体育| 乌拉特前旗| 雅江县| 丰原市| 麻城市|