锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产国拍精品亚洲AV片,国产午夜亚洲精品不卡电影,在线观看免费亚洲http://m.tkk7.com/pixysoft/zh-cnTue, 13 May 2025 02:38:17 GMTTue, 13 May 2025 02:38:17 GMT60AMF 瀛︿範絎旇http://m.tkk7.com/pixysoft/archive/2010/06/17/323706.html寮犺景寮犺景Thu, 17 Jun 2010 06:15:00 GMThttp://m.tkk7.com/pixysoft/archive/2010/06/17/323706.htmlhttp://m.tkk7.com/pixysoft/comments/323706.htmlhttp://m.tkk7.com/pixysoft/archive/2010/06/17/323706.html#Feedback2http://m.tkk7.com/pixysoft/comments/commentRss/323706.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/323706.htmlFlash 涓庡悗鍙頒氦浜掓柟寮忓寘鎷簡錛?/div>
1. LoadVars(xml) 瀹為檯涓婂氨鏄痜lash閲岄潰涓涓璞★紝綾諱技涓涓繛鎺ュ櫒銆傛柊寤轟箣鍚庯紝閫氳繃sendAndLoad鑾峰彇銆佽緗箋傚拰httpposter涓鏍?br /> var data_lv = new LoadVars(); 
2. flash remoting. flash闇瑕佸畨瑁卌omponents錛涘悗鍙版湇鍔″櫒闇瑕丱penAMF銆?br /> gateway_conn = NetServices.createGatewayConnection(); myService = gateway_conn.getService("myservice", this); 
3. webservice 涔熸槸鍦╢lash閲岄潰鍒濆鍖栦竴涓獁s鐨勫璞★紝鐒跺悗璋冪敤銆?span style="border-collapse: collapse; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; ">var ws:WebService = new WebService(ws_url);
4. XMLSocket 涓昏鏄嵆鏃墮氳 var socket:XMLSocket = new XMLSocket();
5. 鐩存帴寮flash鐨剆ocket
http://androider.javaeye.com/blog/268933
鍦ㄤ竴涓狝MF浜や簰鐨勪緥瀛愪腑錛屾湇鍔″櫒寤虹珛涓涓狹AP瀵硅薄錛屼緥濡傦細
   HashMap map=new HashMap();  
   map.put("Event", "浜虹墿縐誨姩");  
   map.put("user", "闂垁嫻瓙");  
   map.put("x", 100);  
   map.put("y", 100);    
榪欐牱flash灝卞彲浠ヨ幏鍙栬繖涓璞★細var obj:Object=new Object();  


寮犺景 2010-06-17 14:15 鍙戣〃璇勮
]]>
Spring 鎶鏈皬緇?/title><link>http://m.tkk7.com/pixysoft/archive/2010/06/17/323681.html</link><dc:creator>寮犺景</dc:creator><author>寮犺景</author><pubDate>Thu, 17 Jun 2010 01:33:00 GMT</pubDate><guid>http://m.tkk7.com/pixysoft/archive/2010/06/17/323681.html</guid><wfw:comment>http://m.tkk7.com/pixysoft/comments/323681.html</wfw:comment><comments>http://m.tkk7.com/pixysoft/archive/2010/06/17/323681.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/pixysoft/comments/commentRss/323681.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/pixysoft/services/trackbacks/323681.html</trackback:ping><description><![CDATA[<p><br /> <strong>1. Spring IoC瀹瑰櫒鐨勬剰涔?br /> </strong><br /> 浣跨敤BeanFactory錛屾牴鎹埗瀹氱殑xml錛?nbsp;鍔ㄦ佺敓鎴愬璞$劧鍚庡姞杞姐?br /> <br /> <span style="color: red">鍙鏄粠BeanFactory鑾峰彇鐨勫璞★紝閮戒細鏍規嵁xml榪涜瑁呴厤銆?/span><br /> <br /> <br /> <strong>2. Spring MVC<br /> </strong><br /> 鍦╳eb.xml閰嶇疆浜咲ispatcherServlet錛岃鎵鏈夎姹傞兘琚繖涓猻ervlet鎷︽埅銆傚悓鏃墮厤緗簡榪欎釜servlet鐨勫垵濮嬪寲瀵硅薄銆?br /> 銆俰nit-param = /WEB-INF/Config.xml -><br /> 銆倂iewResolver錛氾細org.springframework.web.servlet.view.InternalResourceViewResolver<br /> 銆倁rlMapping錛氾細org.springframework.web.servlet.handler.SimpleUrlHandlerMapping<br /> <br /> 榪欎釜urlMapping鐨勭洰鏍囷紝鍙兘鏄spring鎺ョ鐨勫璞★紝渚嬪<strong>SimpleFormController</strong><br /> <br /> <span style="color: red">褰撻厤緗簡DispactcherServlet涔嬪悗錛岄氳繃璁劇疆鍚堥傜殑鍒濆鍖栧璞★紝鑳藉瀹炵幇鏌愮MVC妯″紡銆?/span><br /> <br /> <br /> <br /> 3. spring + blazeds <strong>闆嗘垚<br /> </strong><a >http://static.springsource.org/spring-flex/docs/1.0.x/reference/html/ch02s02.html</a><br /> <br /> 鍦╳eb.xml閰嶇疆浜?涓猟ispatcherservlet<br /> 銆?.service === /WEB-INF/remoting-servlet.xml<br /> 銆?messagebroker/* === /WEB-INF/flex-config.xml 琛ㄧず鎶奲lazeds鐨勮姹傛槧灝勫埌messagebroker<br /> <br /> <br /> 銆傜涓涓猻ervlet緇х畫閰嶇疆浜唘rlMapping <br /> ==<span id="p55vv5j" class="Apple-style-span" style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><span id="tfp3vrt" class="Apple-style-span" style="font-size: 14px; text-indent: 28px; line-height: 22px; font-family: 錕斤拷錕斤拷, 錕斤拷錕斤拷錕斤拷, tahoma, verdana, arial, sans-serif; text-align: left"><span lang="EN-US" style="vertical-align: middle">HessianServiceExporter</span><span style="vertical-align: middle; font-family: 瀹嬩綋">鍙皢涓涓櫘閫?/span><span lang="EN-US" style="vertical-align: middle">bean</span><span style="vertical-align: middle; font-family: 瀹嬩綋">瀵煎嚭鎴愯繙紼嬫湇鍔?榪欐牱榪欎簺琚槧灝勫嚭鏉ョ殑service鍙互閫氳繃url璁塊棶銆?/span></span></span><br /> <span style="color: red">闂錛氳繖浜泂ervice鏈夊浐瀹氱殑鏂規硶錛屾瘮濡俥xecute錛岄偅涔堣繖浜涙柟娉曞浣曡璋冪敤浜嗭紵浠g爜涓婄湅錛屾槸琚玞ommand璋冪敤浜嗐?br /> </span>鍥炵瓟錛氳絎簩涓厤緗?br /> <br /> 銆傜浜屼釜servlet鍚屾牱閰嶇疆浜唘rlMapping錛涜繕鍖呮嫭<br /> ..<font face="Arial">MessageBrokerHandlerAdapter<br /> </font>..<font face="Arial">RemotingDestinationExporter -> <font face="Arial">callDisptacherService</font> -> <font face="Arial">CallDispatcher</font> -> Command.execute<br /> </font><span style="color: red">闂錛氶偅涔圕allDispatcher鐨凜all鏄浣曡皟鐢ㄧ殑錛?br /> </span>鍥炵瓟錛氬湪Flash鐨剎ml鏂囦歡閲岄潰鎸囧畾璋冪敤浜嗐?br /> <br /> </p> <div title="Print Page Break" style="font-size: 1px; page-break-before: always; vertical-align: middle; height: 1px; background-color: #c0c0c0">  </div> <p><br /> 榪欐牱鏁呬簨灝卞叏閮ㄨ涓茶搗鏉ヤ簡銆?br /> <br /> 棣栧厛blazeds鏄釜servlet錛岃灝佽榪囧悗錛岃兘澶熻В鏋恌lash浼犺緭鐨刟mf鏍煎紡銆?br /> <br /> 閫氳繃spring鐨勯厤緗紝flash鐨勮姹傝杞Щ鍒頒簡messagebroker = blazeds錛屽悓鏃惰繖涓猰essagebroker渚濊禆浜嗙壒瀹氱殑bean錛屼緥濡俢allHandler. 榪欎簺handler鍙堜緷璧栦簡service 鐨勫睘鎬э紝榪欎釜灞炴у氨鏄垜鍙互鎺у埗鐨勶紝鍚屾椂琚玣lash璋冪敤鐨勩?br /> <br /> 渚嬪<br /> </p> <div title="Print Page Break" style="font-size: 1px; page-break-before: always; vertical-align: middle; height: 1px; background-color: #c0c0c0">  </div> <p><br /> <br /> <strong>what is web.xml :: listener <br /> </strong> 瀹冭兘鎹曟崏鍒版湇鍔″櫒鐨勫惎鍔ㄥ拰鍋滄! 鍦ㄥ惎鍔ㄥ拰鍋滄瑙﹀彂閲岄潰鐨勬柟娉曞仛鐩稿簲鐨勬搷浣?<br /> 涓瀹氭槸httpServlet<br /> <a >http://zhidao.baidu.com/question/39980900</a><br /> <br /> <br /> <strong>濡備綍鍔犺澆services-config.xml</strong></p> <span id="3nljfpf" class="Apple-style-span" style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><span id="5np5vb3" class="Apple-style-span" style="font-size: 12px; line-height: 18px; font-family: Arial, sans-serif, Helvetica, Tahoma; text-align: left">MessageBrokerFactoryBean灝嗕細鍘誨鎵綛lazeDS鐨勯厤緗枃浠?榛樿浣嶇疆涓?WEB-INF/flex/services-config.xml)</span></span> <img src ="http://m.tkk7.com/pixysoft/aggbug/323681.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/pixysoft/" target="_blank">寮犺景</a> 2010-06-17 09:33 <a href="http://m.tkk7.com/pixysoft/archive/2010/06/17/323681.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oops! Spring Quick Starthttp://m.tkk7.com/pixysoft/archive/2010/06/16/323666.html寮犺景寮犺景Wed, 16 Jun 2010 12:13:00 GMThttp://m.tkk7.com/pixysoft/archive/2010/06/16/323666.htmlhttp://m.tkk7.com/pixysoft/comments/323666.htmlhttp://m.tkk7.com/pixysoft/archive/2010/06/16/323666.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/323666.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/323666.html 鏈枃璁茶В涓涓笉瑙勮寖鐨剆pring quick start.

1. 涓嬭澆spring鐨勬彃浠跺寘錛屼粈涔堢増鏈箣綾葷殑涓嶇敤綆′簡銆傚弽姝h兘鐢ㄣ?br /> spring.jar http://www.boxcn.net/shared/yg306zac1h
common-logging.jar http://www.boxcn.net/shared/ix93ziqljv

2. 榪涘叆eclipse錛孎ile - New - Java Project.
projectname = spring001 ===> Next
鍦ㄦ柊寤哄鍚戠殑絎簩欏碉紝鏄疛ava Settings, 閫夋嫨Libraries -> Add External JARS -> 娣誨姞涓婇潰2涓猨ar
finish

3. 榪涘叆Package Explorer, 鍦╯rc涓嬫柊寤轟竴涓猚lass.
Package = com.java114.spring.test
Name = HelloWordSpring
鍐嶅閫夋錛歱ublic static void main(String[] args) 閽╀笂

4. 鍦℉elloWordSpring.java 杈撳叆浠ヤ笅鐨勪唬鐮?br />
package com.java114.spring.test;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class HelloWordSpring
{
    
private String msg;

    
public void setMsg(String msg)
    {
        
this.msg = msg;
    }

    
public void sayHello()
    {
        System.out.println(msg);
    }

    
public static void main(String[] args)
    {
        Resource res 
= new ClassPathResource("com/java114/spring/test/bean.xml");
        BeanFactory factory 
= new XmlBeanFactory(res);
        HelloWordSpring hello 
= (HelloWordSpring) factory.getBean("helloBean");
        hello.sayHello();
    }

}

5. 鍦ㄥ拰HelloWordSpring.java 鐩稿悓鐩綍涓嬮潰錛屽啀鏂板緩涓涓獂ml鏂囦歡錛屽悕瀛楁槸bean.xml, 鍐呭濡備笅
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd             http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd             http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
 
<bean id="helloBean" class="com.java114.spring.test.HelloWordSpring">
  
<property name="msg" value="simple spring demo"/>
 
</bean>
</beans>
涓轟粈涔堣繖鏍峰啓錛屾垜涔熶笉鐭ラ亾錛屼笉綆′粬銆?br />
6. 榧犳爣鍙抽敭閫夋嫨HelloWordSpring.java, 閫夋嫨Run As - Java Applications錛?寰楀埌緇撴灉錛?br />
2010-6-16 21:39:47 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
淇℃伅: Loading XML bean definitions from class path resource [com/java114/spring/test/bean.xml]
simple spring demo



寮犺景 2010-06-16 20:13 鍙戣〃璇勮
]]>
Oops! Axis quick start ! part 3 -- stubhttp://m.tkk7.com/pixysoft/archive/2008/12/18/247046.html寮犺景寮犺景Thu, 18 Dec 2008 03:03:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/18/247046.htmlhttp://m.tkk7.com/pixysoft/comments/247046.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/18/247046.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/247046.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/247046.html
鍓嶆彁鏉′歡錛?br /> axis瀹夎璺緞 C:\ericsson\javaextend\axis-1_4
欏圭洰鍚嶇О錛歛xisdemo
宸茬粡鏈夌殑綾伙細com.service.myService.java
閰嶇疆鏂囦歡錛歴erver-config.wsdd

1. 鍦ㄩ」鐩坊鍔爅ava2wsdl鐩綍

2.鐩綍涓嬮潰娣誨姞build.xml鏂囦歡
<?xml version="1.0" encoding="UTF-8"?>
<project name="Generate WSDL from JavaBeans as Web Services" default="j2w-all" basedir=".">
    
<property name="build.dir" value="../build/classes" />
    
<property name="axis.dir" location="C:\ericsson\javaextend\axis-1_4" />
    
<path id="classpath.id">
        
<fileset dir="${axis.dir}/lib">
            
<include name="*.jar" />
        
</fileset>
        
<pathelement location="${build.dir}" />
    
</path>
    
<taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask" loaderref="axis">
        
<classpath refid="classpath.id" />
    
</taskdef>
    
<target name="j2w-all">
        
<antcall target="j2w-JavaBeanWS" />
    
</target>
    
<target name="j2w-JavaBeanWS">
        
<axis-java2wsdl classname="com.service.myService" classpath="${build.dir}" methods="getusername" output="myService.wsdl" location="http://localhost:8080/axisdemo/services/myService" namespace="http://localhost:8080/axisdemo/services/myService" namespaceImpl="http://localhost:8080/axisdemo/services/myService">
        
</axis-java2wsdl>
    
</target>
</project>
娉ㄦ剰錛歜uild.dir / axis.dir / j2w-javabeanws鍑犱釜鍦版柟鐨勫唴瀹硅淇敼銆?br />
3. 鍙抽敭鐐瑰嚮build.xml錛岃繍琛宎nt錛屽氨鍙互鐪嬪埌鐢熸垚浜唌yService.wsdl

4.鐜板湪瑕佹妸榪欎釜wsdl杞寲鎴愪負java錛屾柊寤虹洰褰曪細wsdl2java

5. 鏂板緩涓涓猙uild.xml錛屽唴瀹癸細
<?xml version="1.0" encoding="UTF-8"?>
<project name="wsclient" default="all" basedir=".">
    
<property name="axis.home" location="C:\ericsson\javaextend\axis-1_4" />
    
<property name="options.output" location="../wsdl2java" />
    
<path id="axis.classpath">
        
<fileset dir="${axis.home}/lib">
            
<include name="**/*.jar" />
        
</fileset>
    
</path>
    
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
    
<target name="-WSDL2Axis" depends="init">
        
<mkdir dir="${options.output}" />
        
<axis-wsdl2java output="${options.output}" url="${options.WSDL-URI}" verbose="true" />
    
</target>
    
<target name="init">
        
<echo>Warning: please update the associated WSDL file(s) in the folder wsdl before running the target!</echo>
        
<echo>Warning: Just run the target(s) related with your developing work!</echo>
        
<echo>
        
</echo>
    
</target>
    
<target name="all">
        
<antcall target="myService" />
    
</target>
    
<target name="myService">
        
<antcall target="-WSDL2Axis">
            
<param name="options.WSDL-URI" location="../java2wsdl/myService.wsdl" />
        
</antcall>
    
</target>
</project>
娉ㄦ剰淇敼鐨勫湴鏂癸細axis.home

6.build ant錛屽湪wsdl2java鐩綍涓嬮潰澶氬嚭鏉ヤ簡4涓被錛?br /> myService.java
MyServiceService.java
myServiceServiceLocator.java
MyServiceSoapBindingStub.java
鍏ㄩ儴鎷瘋礉鍒皊rc鐩綍涓嬮潰

7.鍦╯rc鐩綍涓嬮潰娣誨姞綾伙細
package com.axistest;

import localhost.axisdemo.services.myService.MyService;
import localhost.axisdemo.services.myService.MyServiceServiceLocator;

public class myServiceTestorByStubs
{
    
public static void main(String[] args) throws Exception
    {
        MyServiceServiceLocator Service 
= new MyServiceServiceLocator();
        MyService port 
= Service.getmyService();
        String response 
  port.getusername(閭硅悕");
        System.out.println(response);
    }
}

8.鏈鍚庤繍琛宩ava application灝卞畬鎴愪簡




寮犺景 2008-12-18 11:03 鍙戣〃璇勮
]]>
Oops! Axis quick start ! part 2 -- wsddhttp://m.tkk7.com/pixysoft/archive/2008/12/17/246851.html寮犺景寮犺景Wed, 17 Dec 2008 05:51:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/17/246851.htmlhttp://m.tkk7.com/pixysoft/comments/246851.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/17/246851.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/246851.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/246851.html  part1


1. in package explorer, change myService.java:
package com.service;
public class myService {
public String getusername(String name){
        
return "Hello "+name+",this is an Axis Web Service";
    }
}
and ctrl+1 to solve the package problem( or you can create dir and move file yourself)

2.in WebContent/WEB-INF/, create server-config.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler type="java:org.apache.axis.handlers.http.URLMapper" name="URLMapper"/>    
   
<service name="myService" provider="java:RPC">
        
<parameter name="className" value="com.service.myService"/>
        
<parameter name="allowedMethods" value="getusername"/>
    
</service> 
<transport name="http">
 
<requestFlow>
    
<handler type="URLMapper"/>
 
</requestFlow>
</transport>
</deployment>

3. in src/, create myServiceTestorByWSDD.java
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class myServiceTestorByWSDD {
public tatic void main(String[] args) throws ServiceException,MalformedURLException, RemoteException {
        String endpoint 
= http://localhost:8080/oopsaxis1/services/myService;
        Service service 
= new Service();                // 鍒涘緩涓涓猄ervice瀹炰緥錛屾敞鎰忔槸蹇呴』鐨勶紒
        Call call = (Call) service.createCall();   // 鍒涘緩Call瀹炰緥錛屼篃鏄繀欏葷殑錛?/span>
        call.setTargetEndpointAddress(new java.net.URL(endpoint));// 涓篊all璁劇疆鏈嶅姟鐨勪綅緗?/span>
        call.setOperationName("getusername");              // 娉ㄦ剰鏂規硶鍚嶄笌JavaBeanWS.java涓竴鏍鳳紒錛?/span>
        String res = (String) call.invoke(new Object[] { "pixysoft" });       // 榪斿洖String錛屼紶鍏ュ弬鏁?/span>
        System.out.println(res);
}
}

4. open tomcat, and :http://localhost:8080/oopsaxis1/servlet/AxisServlet,you can see:
And now Some Services
myService (wsdl) 
getusername 

5. right click myServiceTestorByWSDD.java, run as java application.


done!



寮犺景 2008-12-17 13:51 鍙戣〃璇勮
]]>
Oops! Axis quick start ! part 1 -- simple demohttp://m.tkk7.com/pixysoft/archive/2008/12/17/246849.html寮犺景寮犺景Wed, 17 Dec 2008 05:40:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/17/246849.htmlhttp://m.tkk7.com/pixysoft/comments/246849.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/17/246849.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/246849.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/246849.htmlreference:

http://www.cnblogs.com/cy163/archive/2008/11/28/1343516.html

pre-condition:
1.install eclipse
2.install tomcat plugin

process:
1.download axis lib: http://ws.apache.org/axis

2. set classpath:
1錛嶢XIS_HOME
D:\Java\axis-1_4錛堣繖鏄垜鐨凙xis璺緞錛?br /> 2錛嶢XIS_LIB
%AXIS_HOME%\lib
3錛嶢XIS_CLASSPATH
%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar;%AXIS_LIB%\wsdl4j-1.5.1.jar;%AXIS_LIB%\activation.jar;%AXIS_LIB%\xmlrpc-2.0.jar
4錛嶤LASSPATH
.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar; %AXIS_CLASSPATH%;
5錛庡湪浣犵殑%TOMCAT_HOME%\common\lib涓嬮渶瑕佸姞鍏ヤ笁涓寘 activation.jar銆乵ail.jar銆乼ools.jar錛屾敞鎰忚繖涓変釜鍖呮槸蹇呴』鐨勶紝灝界tools.jar寰堝父瑙侊紝浣嗚繖涔熸槸榪愯Axis鎵蹇呴』鐨勫寘銆?br />

3.FIle - new - dynamic web project
projectname: oopsaxis1
target runtime: apache tomcat V5.5


4. oopsaxis1/WebContent/WEB-INF/lib,add lib from %AXIS_HOME%\lib
axis.jar/axis-ant.jar/commons-log.jar...

5.oopsaxis1/WebContent/WEB-INF/web.xml,  replace by %AXIS_HOME%\webapps\axis\WEB-INF\web.xml

6.oopsaxis1/src, add java file:
public class myService
{
    
public String getusername(String name)
    {
        
return "Hello " + name + ",this is an Axis DII Web Service";
    }
}


7.copy myService to oopsaxis1/WebContent, and rename to myService.jws

8. right click myService.jws, run as - run on server, you can see:
http://localhost:8080/oopsaxis1/myService.jws
There is a Web Service here
Click to see the WSDL 
click the link, you can see the wsdl


9. in eclipse - package explorer - src, new class:
package com.oopsaxis;

import java.net.MalformedURLException;
import java.rmi.RemoteException;

import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

public class myServiceTestorByjws
{
    
public static void main(String[] args) throws ServiceException,
            MalformedURLException, RemoteException
    {
        String endpoint 
= http://localhost:8080/oopsaxis1/myService.jws;
        String name 
= " pixysoft";
        Service service 
= new Service();
        Call call 
= (Call) service.createCall();

        call.setTargetEndpointAddress(
new java.net.URL(endpoint));
        call.addParameter(
"param1", XMLType.XSD_STRING, ParameterMode.IN);
        call.setOperationName(
"getusername");
        call.setReturnType(XMLType.XSD_STRING);
        String ret 
= (String) call.invoke(new Object[] { name });
        System.out.println(
"榪斿洖緇撴灉錛?/span>" + ret);
    }
}

10. right click myServiceTestorByjws, run as java application,you get:
榪斿洖緇撴灉錛欻ello pixysoft,this is an Axis DII Web Service

done!


寮犺景 2008-12-17 13:40 鍙戣〃璇勮
]]>
Oops! Ant reference.http://m.tkk7.com/pixysoft/archive/2008/12/05/244584.html寮犺景寮犺景Fri, 05 Dec 2008 05:41:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/05/244584.htmlhttp://m.tkk7.com/pixysoft/comments/244584.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/05/244584.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/244584.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/244584.htmlUsing Ant

Writing a Simple Buildfile

Ant's buildfiles are written in XML. Each buildfile contains one project and at least one (default) target. Targets contain task elements. Each task element of the buildfile can have an id attribute and can later be referred to by the value supplied to this. The value has to be unique. (For additional information, see the Tasks section below.)

Projects

A project has three attributes:

Attribute Description Required
name the name of the project. No
default the default target to use when no target is supplied. No; however, since Ant 1.6.0, every project includes an implicit target that contains any and all top-level tasks and/or types. This target will always be executed as part of the project's initialization, even when Ant is run with the -projecthelp option.
basedir the base directory from which all path calculations are done. This attribute might be overridden by setting the "basedir" property beforehand. When this is done, it must be omitted in the project tag. If neither the attribute nor the property have been set, the parent directory of the buildfile will be used. No

Optionally, a description for the project can be provided as a top-level <description> element (see the description type).

Each project defines one or more targets. A target is a set of tasks you want to be executed. When starting Ant, you can select which target(s) you want to have executed. When no target is given, the project's default is used.

Targets

A target can depend on other targets. You might have a target for compiling, for example, and a target for creating a distributable. You can only build a distributable when you have compiled first, so the distribute target depends on the compile target. Ant resolves these dependencies.

It should be noted, however, that Ant's depends attribute only specifies the order in which targets should be executed - it does not affect whether the target that specifies the dependency(s) gets executed if the dependent target(s) did not (need to) run.

Ant tries to execute the targets in the depends attribute in the order they appear (from left to right). Keep in mind that it is possible that a target can get executed earlier when an earlier target depends on it:

<target name="A"/>
<target name="B" depends="A"/>
<target name="C" depends="B"/>
<target name="D" depends="C,B,A"/>

Suppose we want to execute target D. From its depends attribute, you might think that first target C, then B and then A is executed. Wrong! C depends on B, and B depends on A, so first A is executed, then B, then C, and finally D.

In a chain of dependencies stretching back from a given target such as D above, each target gets executed only once, even when more than one target depends on it. Thus, executing the D target will first result in C being called, which in turn will first call B, which in turn will first call A. After A, then B, then C have executed, execution returns to the dependency list of D, which will not call B and A, since they were already called in process of dependency resolution for C and B respectively as dependencies of D. Had no such dependencies been discovered in processing C and B, B and A would have been executed after C in processing D's dependency list.

A target also has the ability to perform its execution if (or unless) a property has been set. This allows, for example, better control on the building process depending on the state of the system (java version, OS, command-line property defines, etc.). To make a target sense this property, you should add the if (or unless) attribute with the name of the property that the target should react to. Note: Ant will only check whether the property has been set, the value doesn't matter. A property set to the empty string is still an existing property. For example:

<target name="build-module-A" if="module-A-present"/>
<target name="build-own-fake-module-A" unless="module-A-present"/>

In the first example, if the module-A-present property is set (to any value, e.g. false), the target will be run. In the second example, if the module-A-present property is set (again, to any value), the target will not be run.

Only one propertyname can be specified in the if/unless clause. If you want to check multiple conditions, you can use a dependend target for computing the result for the check:

<target name="myTarget" depends="myTarget.check" if="myTarget.run">
<echo>Files foo.txt and bar.txt are present.</echo>
</target>
<target name="myTarget.check">
<condition property="myTarget.run">
<and>
<available file="foo.txt"/>
<available file="bar.txt"/>
</and>
</condition>
</target>

If no if and no unless attribute is present, the target will always be executed.

Important: the if and unless attributes only enable or disable the target to which they are attached. They do not control whether or not targets that a conditional target depends upon get executed. In fact, they do not even get evaluated until the target is about to be executed, and all its predecessors have already run.

The optional description attribute can be used to provide a one-line description of this target, which is printed by the -projecthelp command-line option. Targets without such a description are deemed internal and will not be listed, unless either the -verbose or -debug option is used.

It is a good practice to place your tstamp tasks in a so-called initialization target, on which all other targets depend. Make sure that target is always the first one in the depends list of the other targets. In this manual, most initialization targets have the name "init".

If the depends attribute and the if/unless attribute are set, the depends attribute is executed first.

A target has the following attributes:

Attribute Description Required
name the name of the target. Yes
depends a comma-separated list of names of targets on which this target depends. No
if the name of the property that must be set in order for this target to execute. No
unless the name of the property that must not be set in order for this target to execute. No
description a short description of this target's function. No

 

A target name can be any alphanumeric string valid in the encoding of the XML file. The empty string "" is in this set, as is comma "," and space " ". Please avoid using these, as they will not be supported in future Ant versions because of all the confusion they cause. IDE support of unusual target names, or any target name containing spaces, varies with the IDE.

Targets beginning with a hyphen such as "-restart" are valid, and can be used to name targets that should not be called directly from the command line.

Tasks

A task is a piece of code that can be executed.

A task can have multiple attributes (or arguments, if you prefer). The value of an attribute might contain references to a property. These references will be resolved before the task is executed.

Tasks have a common structure:

<name attribute1="value1" attribute2="value2" ... />

where name is the name of the task, attributeN is the attribute name, and valueN is the value for this attribute.

There is a set of built-in tasks, along with a number of optional tasks, but it is also very easy to write your own.

All tasks share a task name attribute. The value of this attribute will be used in the logging messages generated by Ant.

Tasks can be assigned an id attribute:
<taskname id="taskID" ... />
where taskname is the name of the task, and taskID is a unique identifier for this task. You can refer to the corresponding task object in scripts or other tasks via this name. For example, in scripts you could do:
<script ... >
task1.setFoo("bar");
</script>
to set the foo attribute of this particular task instance. In another task (written in Java), you can access the instance via project.getReference("task1").

Note1: If "task1" has not been run yet, then it has not been configured (ie., no attributes have been set), and if it is going to be configured later, anything you've done to the instance may be overwritten.

Note2: Future versions of Ant will most likely not be backward-compatible with this behaviour, since there will likely be no task instances at all, only proxies.

Properties

A project can have a set of properties. These might be set in the buildfile by the property task, or might be set outside Ant. A property has a name and a value; the name is case-sensitive. Properties may be used in the value of task attributes. This is done by placing the property name between "${" and "}" in the attribute value. For example, if there is a "builddir" property with the value "build", then this could be used in an attribute like this: ${builddir}/classes. This is resolved at run-time as build/classes.

In the event you should need to include this construct literally (i.e. without property substitutions), simply "escape" the '$' character by doubling it. To continue the previous example:

  <echo>$${builddir}=${builddir}</echo>
will echo this message:
  ${builddir}=build/classes

 

In order to maintain backward compatibility with older Ant releases, a single '$' character encountered apart from a property-like construct (including a matched pair of french braces) will be interpreted literally; that is, as '$'. The "correct" way to specify this literal character, however, is by using the escaping mechanism unconditionally, so that "$$" is obtained by specifying "$$$$". Mixing the two approaches yields unpredictable results, as "$$$" results in "$$".

Built-in Properties

Ant provides access to all system properties as if they had been defined using a <property> task. For example, ${os.name} expands to the name of the operating system.

For a list of system properties see the Javadoc of System.getProperties.

In addition, Ant has some built-in properties:

basedir             the absolute path of the project's basedir (as set
with the basedir attribute of <project>).
ant.file            the absolute path of the buildfile.
ant.version         the version of Ant
ant.project.name    the name of the project that is currently executing;
it is set in the name attribute of <project>.
ant.java.version    the JVM version Ant detected; currently it can hold
the values "1.2", "1.3", "1.4" and "1.5".

There is also another property, but this is set by the launcher script and therefore maybe not set inside IDEs:

ant.home            home directory of Ant

Example Buildfile

<project name="MyProject" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist"  location="dist"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>

Notice that we are declaring properties outside any target. As of Ant 1.6 all tasks can be declared outside targets (earlier version only allowed <property>,<typedef> and <taskdef>). When you do this they are evaluated before any targets are executed. Some tasks will generate build failures if they are used outside of targets as they may cause infinite loops otherwise (<antcall> for example).

We have given some targets descriptions; this causes the projecthelp invocation option to list them as public targets with the descriptions; the other target is internal and not listed.

Finally, for this target to work the source in the src subdirectory should be stored in a directory tree which matches the package names. Check the <javac> task for details.

Token Filters

A project can have a set of tokens that might be automatically expanded if found when a file is copied, when the filtering-copy behavior is selected in the tasks that support this. These might be set in the buildfile by the filter task.

Since this can potentially be a very harmful behavior, the tokens in the files must be of the form @token@, where token is the token name that is set in the <filter> task. This token syntax matches the syntax of other build systems that perform such filtering and remains sufficiently orthogonal to most programming and scripting languages, as well as with documentation systems.

Note: If a token with the format @token@ is found in a file, but no filter is associated with that token, no changes take place; therefore, no escaping method is available - but as long as you choose appropriate names for your tokens, this should not cause problems.

Warning: If you copy binary files with filtering turned on, you can corrupt the files. This feature should be used with text files only.

Path-like Structures

You can specify PATH- and CLASSPATH-type references using both ":" and ";" as separator characters. Ant will convert the separator to the correct character of the current operating system.

Wherever path-like values need to be specified, a nested element can be used. This takes the general form of:

    <classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>

The location attribute specifies a single file or directory relative to the project's base directory (or an absolute filename), while the path attribute accepts colon- or semicolon-separated lists of locations. The path attribute is intended to be used with predefined paths - in any other case, multiple elements with location attributes should be preferred.

As a shortcut, the <classpath> tag supports path and location attributes of its own, so:

    <classpath>
<pathelement path="${classpath}"/>
</classpath>

can be abbreviated to:

    <classpath path="${classpath}"/>

In addition, one or more Resource Collections can be specified as nested elements (these must consist of file-type resources only). Additionally, it should be noted that although resource collections are processed in the order encountered, certain resource collection types such as fileset, dirset and files are undefined in terms of order.

    <classpath>
<pathelement path="${classpath}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
<dirset dir="${build.dir}">
<include name="apps/**/classes"/>
<exclude name="apps/**/*Test*"/>
</dirset>
<filelist refid="third-party_jars"/>
</classpath>

This builds a path that holds the value of ${classpath}, followed by all jar files in the lib directory, the classes directory, all directories named classes under the apps subdirectory of ${build.dir}, except those that have the text Test in their name, and the files specified in the referenced FileList.

If you want to use the same path-like structure for several tasks, you can define them with a <path> element at the same level as targets, and reference them via their id attribute--see References for an example.

A path-like structure can include a reference to another path-like structure (a path being itself a resource collection) via nested <path> elements:

    <path id="base.path">
<pathelement path="${classpath}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
</path>
<path id="tests.path">
<path refid="base.path"/>
<pathelement location="testclasses"/>
</path>
The shortcuts previously mentioned for <classpath> are also valid for <path>.For example:
    <path id="base.path">
<pathelement path="${classpath}"/>
</path>
can be written as:
    <path id="base.path" path="${classpath}"/>

Path Shortcut

In Ant 1.6 a shortcut for converting paths to OS specific strings in properties has been added. One can use the expression ${toString:pathreference} to convert a path element reference to a string that can be used for a path argument. For example:

  <path id="lib.path.ref">
<fileset dir="lib" includes="*.jar"/>
</path>
<javac srcdir="src" destdir="classes">
<compilerarg arg="-Xbootstrap/p:${toString:lib.path.ref}"/>
</javac>

Command-line Arguments

Several tasks take arguments that will be passed to another process on the command line. To make it easier to specify arguments that contain space characters, nested arg elements can be used.

Attribute Description Required
value a single command-line argument; can contain space characters. Exactly one of these.
file The name of a file as a single command-line argument; will be replaced with the absolute filename of the file.
path A string that will be treated as a path-like string as a single command-line argument; you can use ; or : as path separators and Ant will convert it to the platform's local conventions.
pathref Reference to a path defined elsewhere. Ant will convert it to the platform's local conventions.
line a space-delimited list of command-line arguments.

It is highly recommended to avoid the line version when possible. Ant will try to split the command line in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect under some circumstances.

Examples

  <arg value="-l -a"/>

is a single command-line argument containing a space character, not separate commands "-l" and "-a".

  <arg line="-l -a"/>

This is a command line with two separate arguments, "-l" and "-a".

  <arg path="/dir;/dir2:\dir3"/>

is a single command-line argument with the value \dir;\dir2;\dir3 on DOS-based systems and /dir:/dir2:/dir3 on Unix-like systems.

References

Any project element can be assigned an identifier using its id attribute. In most cases the element can subsequently be referenced by specifying the refid attribute on an element of the same type. This can be useful if you are going to replicate the same snippet of XML over and over again--using a <classpath> structure more than once, for example.

The following example:

<project ... >
<target ... >
<rmic ...>
<classpath>
<pathelement location="lib/"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/>
</classpath>
</rmic>
</target>
<target ... >
<javac ...>
<classpath>
<pathelement location="lib/"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/>
</classpath>
</javac>
</target>
</project>

could be rewritten as:

<project ... >
<path id="project.class.path">
<pathelement location="lib/"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/>
</path>
<target ... >
<rmic ...>
<classpath refid="project.class.path"/>
</rmic>
</target>
<target ... >
<javac ...>
<classpath refid="project.class.path"/>
</javac>
</target>
</project>

All tasks that use nested elements for PatternSets, FileSets, ZipFileSets or path-like structures accept references to these structures as shown in the examples. Using refid on a task will ordinarily have the same effect (referencing a task already declared), but the user should be aware that the interpretation of this attribute is dependent on the implementation of the element upon which it is specified. Some tasks (the property task is a handy example) deliberately assign a different meaning to refid.

Use of external tasks

Ant supports a plugin mechanism for using third party tasks. For using them you have to do two steps:
  1. place their implementation somewhere where Ant can find them
  2. declare them.
Don't add anything to the CLASSPATH environment variable - this is often the reason for very obscure errors. Use Ant's own mechanisms for adding libraries:
  • via command line argument -lib
  • adding to ${user.home}/.ant/lib
  • adding to ${ant.home}/lib
For the declaration there are several ways:
  • declare a single task per using instruction using <taskdef name="taskname" classname="ImplementationClass"/>
    <taskdef name="for" classname="net.sf.antcontrib.logic.For" /> <for ... />
  • declare a bundle of tasks using a properties-file holding these taskname-ImplementationClass-pairs and <taskdef>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <for ... />
  • declare a bundle of tasks using a xml-file holding these taskname-ImplementationClass-pairs and <taskdef>
    <taskdef resource="net/sf/antcontrib/antlib.xml" /> <for ... />
  • declare a bundle of tasks using a xml-file named antlib.xml, XML-namespace and antlib: protocoll handler
    <project xmlns:ac="antlib:net.sf.antconrib"/> <ac:for ... />
If you need a special function, you should
  1. have a look at this manual, because Ant provides lot of tasks
  2. have a look at the external task page in the manual (or better online)
  3. have a look at the external task wiki page
  4. ask on the Ant user list
  5. implement (and share) your own


寮犺景 2008-12-05 13:41 鍙戣〃璇勮
]]>
Oops! Ant quick start 4 ! - 鍖呭惈junithttp://m.tkk7.com/pixysoft/archive/2008/12/04/244377.html寮犺景寮犺景Thu, 04 Dec 2008 07:03:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/04/244377.htmlhttp://m.tkk7.com/pixysoft/comments/244377.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/04/244377.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/244377.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/244377.html
public class HelloWorldTest extends junit.framework.TestCase {

    
public void testNothing() {
    }
    
    
public void testWillAlwaysFail() {
        fail(
"An error message");
    }
    
}

2.鍦╨ib鐩綍涓嬮潰娣誨姞junit.jar綾?br />
3.淇敼build.xml鏂囦歡濡備笅錛?br />
<project name="HelloWorld" basedir="." default="main">

    
<property name="src.dir" value="src" />

    
<property name="build.dir" value="build" />
    
<property name="classes.dir" value="${build.dir}/classes" />
    
<property name="jar.dir" value="${build.dir}/jar" />
    
<property name="lib.dir" value="lib" />
    
<path id="classpath">
        
<fileset dir="${lib.dir}" includes="**/*.jar" />
    
</path>

    
<property name="main-class" value="oata.HelloWorld" />



    
<target name="clean">
        
<delete dir="${build.dir}" />
    
</target>

    
<target name="compile">
        
<mkdir dir="${classes.dir}" />
        
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" />
        
<copy todir="${classes.dir}">
            
<fileset dir="${src.dir}" excludes="**/*.java" />
        
</copy>

    
</target>

    
<target name="jar" depends="compile">
        
<mkdir dir="${jar.dir}" />
        
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
            
<manifest>
                
<attribute name="Main-Class" value="${main-class}" />
            
</manifest>
        
</jar>
    
</target>

    
<target name="run" depends="jar">
        
<java fork="true" classname="${main-class}">
            
<classpath>
                
<path refid="classpath" />
                
<path id="application" location="${jar.dir}/${ant.project.name}.jar" />
            
</classpath>
        
</java>

    
</target>
    
<target name="junit" depends="jar">
        
<junit printsummary="yes">
            
<classpath>
                
<path refid="classpath" />
                
<path refid="application" />
            
</classpath>

            
<batchtest fork="yes">
                
<fileset dir="${src.dir}" includes="*Test.java" />
            
</batchtest>
        
</junit>
    
</target>

    
<target name="clean-build" depends="clean,jar" />

    
<target name="main" depends="clean,run" />

</project>


娉細淇敼鍦版柟濡備笅錛?br />
    

    
<target name="run" depends="jar">
        
<java fork="true" classname="${main-class}">
            
<classpath>
                
<path refid="classpath"/>
                
<path id="application" location="${jar.dir}/${ant.project.name}.jar"/>
            
</classpath>
        
</java>
    
</target>
    
    
<target name="junit" depends="jar">
        
<junit printsummary="yes">
            
<classpath>
                
<path refid="classpath"/>
                
<path refid="application"/>
            
</classpath>
            
            
<batchtest fork="yes">
                
<fileset dir="${src.dir}" includes="*Test.java"/>
            
</batchtest>
        
</junit>
    
</target>

    



6榪愯錛屽緱鍒扮粨鏋滐細
...
junit:
    [junit] Running HelloWorldTest
    [junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 0,01 sec
    [junit] Test HelloWorldTest FAILED

BUILD SUCCESSFUL
...


寮犺景 2008-12-04 15:03 鍙戣〃璇勮
]]>
Oops! Ant quick start 3 ! - 鍖呭惈澶栭儴綾?/title><link>http://m.tkk7.com/pixysoft/archive/2008/12/04/244366.html</link><dc:creator>寮犺景</dc:creator><author>寮犺景</author><pubDate>Thu, 04 Dec 2008 06:22:00 GMT</pubDate><guid>http://m.tkk7.com/pixysoft/archive/2008/12/04/244366.html</guid><wfw:comment>http://m.tkk7.com/pixysoft/comments/244366.html</wfw:comment><comments>http://m.tkk7.com/pixysoft/archive/2008/12/04/244366.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/pixysoft/comments/commentRss/244366.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/pixysoft/services/trackbacks/244366.html</trackback:ping><description><![CDATA[1.鍦ㄤ笂鏂囧熀紜涓婏紝淇敼婧愪唬鐮?HelloWorld.java<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #0000ff">package</span><span style="color: #000000"> oata;<br /> <br /> </span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.log4j.Logger;<br /> </span><span style="color: #0000ff">import</span><span style="color: #000000"> org.apache.log4j.BasicConfigurator;<br /> <br /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> HelloWorld {<br />     </span><span style="color: #0000ff">static</span><span style="color: #000000"> Logger logger </span><span style="color: #000000">=</span><span style="color: #000000"> Logger.getLogger(HelloWorld.</span><span style="color: #0000ff">class</span><span style="color: #000000">);<br /> <br />     </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) {<br />         BasicConfigurator.configure();<br />         logger.info(</span><span style="color: #000000">"</span><span style="color: #000000">Hello World</span><span style="color: #000000">"</span><span style="color: #000000">);          </span><span style="color: #008000">//</span><span style="color: #008000"> the old SysO-statement</span><span style="color: #008000"><br /> </span><span style="color: #000000">    }<br /> }<br /> </span></div> <br /> 2. 鍦╦avademo鐩綍涓嬮潰娣誨姞lib鐩綍錛岄噷闈㈡坊鍔爈og4j鐨刯ar鏂囦歡<br /> <br /> 3.淇敼build.xml錛?br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #0000ff"><</span><span style="color: #800000">project </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="HelloWorld"</span><span style="color: #ff0000"> basedir</span><span style="color: #0000ff">="."</span><span style="color: #ff0000"> default</span><span style="color: #0000ff">="main"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="src.dir"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="src"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="build.dir"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="build"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="classes.dir"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="${build.dir}/classes"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jar.dir"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="${build.dir}/jar"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="lib.dir"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="lib"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">path </span><span style="color: #ff0000">id</span><span style="color: #0000ff">="classpath"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">fileset </span><span style="color: #ff0000">dir</span><span style="color: #0000ff">="${lib.dir}"</span><span style="color: #ff0000"> includes</span><span style="color: #0000ff">="**/*.jar"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">path</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> </span><span style="color: #0000ff"><</span><span style="color: #800000">property </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="main-class"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="oata.HelloWorld"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <br /> <br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="clean"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">delete </span><span style="color: #ff0000">dir</span><span style="color: #0000ff">="${build.dir}"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">target</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="compile"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">mkdir </span><span style="color: #ff0000">dir</span><span style="color: #0000ff">="${classes.dir}"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">javac </span><span style="color: #ff0000">srcdir</span><span style="color: #0000ff">="${src.dir}"</span><span style="color: #ff0000"> destdir</span><span style="color: #0000ff">="${classes.dir}"</span><span style="color: #ff0000"> classpathref</span><span style="color: #0000ff">="classpath"</span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">target</span><span style="color: #0000ff">></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jar"</span><span style="color: #ff0000"> depends</span><span style="color: #0000ff">="compile"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">mkdir </span><span style="color: #ff0000">dir</span><span style="color: #0000ff">="${jar.dir}"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">jar </span><span style="color: #ff0000">destfile</span><span style="color: #0000ff">="${jar.dir}/${ant.project.name}.jar"</span><span style="color: #ff0000"> basedir</span><span style="color: #0000ff">="${classes.dir}"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />             </span><span style="color: #0000ff"><</span><span style="color: #800000">manifest</span><span style="color: #0000ff">></span><span style="color: #000000"><br />                 </span><span style="color: #0000ff"><</span><span style="color: #800000">attribute </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="Main-Class"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="${main-class}"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />             </span><span style="color: #0000ff"></</span><span style="color: #800000">manifest</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"></</span><span style="color: #800000">jar</span><span style="color: #0000ff">></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">target</span><span style="color: #0000ff">></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="run"</span><span style="color: #ff0000"> depends</span><span style="color: #0000ff">="jar"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"><</span><span style="color: #800000">java </span><span style="color: #ff0000">fork</span><span style="color: #0000ff">="true"</span><span style="color: #ff0000"> classname</span><span style="color: #0000ff">="${main-class}"</span><span style="color: #0000ff">></span><span style="color: #000000"><br />             </span><span style="color: #0000ff"><</span><span style="color: #800000">classpath</span><span style="color: #0000ff">></span><span style="color: #000000"><br />                 </span><span style="color: #0000ff"><</span><span style="color: #800000">path </span><span style="color: #ff0000">refid</span><span style="color: #0000ff">="classpath"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />                 </span><span style="color: #0000ff"><</span><span style="color: #800000">path </span><span style="color: #ff0000">location</span><span style="color: #0000ff">="${jar.dir}/${ant.project.name}.jar"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />             </span><span style="color: #0000ff"></</span><span style="color: #800000">classpath</span><span style="color: #0000ff">></span><span style="color: #000000"><br />         </span><span style="color: #0000ff"></</span><span style="color: #800000">java</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">target</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="clean-build"</span><span style="color: #ff0000"> depends</span><span style="color: #0000ff">="clean,jar"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">target </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="main"</span><span style="color: #ff0000"> depends</span><span style="color: #0000ff">="clean,run"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br /> <br /> </span><span style="color: #0000ff"></</span><span style="color: #800000">project</span><span style="color: #0000ff">></span></div> <br /> 4. 榪愯ant<br /> <img src ="http://m.tkk7.com/pixysoft/aggbug/244366.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/pixysoft/" target="_blank">寮犺景</a> 2008-12-04 14:22 <a href="http://m.tkk7.com/pixysoft/archive/2008/12/04/244366.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oops! Ant quick start 2 ! - ant compilehttp://m.tkk7.com/pixysoft/archive/2008/12/04/244339.html寮犺景寮犺景Thu, 04 Dec 2008 03:50:00 GMThttp://m.tkk7.com/pixysoft/archive/2008/12/04/244339.htmlhttp://m.tkk7.com/pixysoft/comments/244339.htmlhttp://m.tkk7.com/pixysoft/archive/2008/12/04/244339.html#Feedback0http://m.tkk7.com/pixysoft/comments/commentRss/244339.htmlhttp://m.tkk7.com/pixysoft/services/trackbacks/244339.html
<project>

    
<target name="clean">
        
<delete dir="build"/>
    
</target>

    
<target name="compile">
        
<mkdir dir="build/classes"/>
        
<javac srcdir="src" destdir="build/classes"/>
    
</target>

    
<target name="jar">
        
<mkdir dir="build/jar"/>
        
<jar destfile="build/jar/HelloWorld.jar" basedir="build/classes">
            
<manifest>
                
<attribute name="Main-Class" value="oata.HelloWorld"/>
            
</manifest>
        
</jar>
    
</target>

    
<target name="run">
        
<java jar="build/jar/HelloWorld.jar" fork="true"/>
    
</target>

</project>

2.榪愯錛?br /> ant compile
ant jar
ant run
鐪嬪埌緇撴灉

娉ㄦ剰錛氳鍦ㄧ郴緇熺幆澧冮噷闈㈣緗甈ATH鍒癮nt鐨刡in鐩綍

3.鏇村姞綆渚跨殑鎵撳寘錛氫慨鏀筨uild.xml錛屼負錛?br />
<project name="HelloWorld" basedir="." default="main">

    
<property name="src.dir"     value="src"/>

    
<property name="build.dir"   value="build"/>
    
<property name="classes.dir" value="${build.dir}/classes"/>
    
<property name="jar.dir"     value="${build.dir}/jar"/>

    
<property name="main-class"  value="oata.HelloWorld"/>



    
<target name="clean">
        
<delete dir="${build.dir}"/>
    
</target>

    
<target name="compile">
        
<mkdir dir="${classes.dir}"/>
        
<javac srcdir="${src.dir}" destdir="${classes.dir}"/>
    
</target>

    
<target name="jar" depends="compile">
        
<mkdir dir="${jar.dir}"/>
        
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
            
<manifest>
                
<attribute name="Main-Class" value="${main-class}"/>
            
</manifest>
        
</jar>
    
</target>

    
<target name="run" depends="jar">
        
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
    
</target>

    
<target name="clean-build" depends="clean,jar"/>

    
<target name="main" depends="clean,run"/>

</project>


寮犺景 2008-12-04 11:50 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产精品亚洲а∨天堂2021| 性xxxx视频播放免费| 日韩亚洲人成网站| 亚洲成AV人综合在线观看| 亚洲一区二区三区在线视频| 成年男女男精品免费视频网站| 99xxoo视频在线永久免费观看| 成人免费网站视频www| 亚洲乱色熟女一区二区三区蜜臀| 亚洲美女aⅴ久久久91| 久久夜色精品国产亚洲AV动态图| 亚洲精品A在线观看| 国产中文字幕免费| 在线观看免费成人| 免费看国产精品3a黄的视频| 久久精品一本到99热免费| 成人免费无码H在线观看不卡| 黄色毛片免费在线观看| 亚洲AV日韩AV一区二区三曲| 亚洲大成色www永久网址| 亚洲伊人久久大香线蕉在观| 91亚洲va在线天线va天堂va国产| 亚洲VA中文字幕无码一二三区 | 青草青草视频2免费观看| 久久水蜜桃亚洲AV无码精品| 亚洲免费在线观看视频| 亚洲人成网网址在线看| 亚洲中文字幕久在线| 亚洲国产电影在线观看| 亚洲一级视频在线观看| 亚洲av无码片区一区二区三区| 亚洲国产片在线观看| 久久亚洲精品专区蓝色区| 亚洲无限乱码一二三四区| 亚洲国产成人精品青青草原| 亚洲国产美女福利直播秀一区二区| 亚洲欧洲日本国产| 国产成人精品日本亚洲直接| 亚洲乱妇老熟女爽到高潮的片 | 成年黄网站色大免费全看| 巨波霸乳在线永久免费视频 |