Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java webservice ·þÎñÆ÷´úÂë»ñÈ¡ÇëÇó¿Í»§¶ËµÄIPµØÖ·

 package test;
import javax.annotation.Resource;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
@javax.jws.WebService(targetNamespace = "http://test/", serviceName = "WebServiceTestService", portName = "WebServiceTestPort", wsdlLocation = "WEB-INF/wsdl/WebServiceTestService.wsdl")
public class WebServiceTestDelegate {
 test.WebServiceTest webServiceTest = new test.WebServiceTest();
 @Resource
 private WebServiceContext wsContext;
 public String getServiceStr(String str) {
  MessageContext mc = wsContext.getMessageContext();
  ServletContext servlet = (ServletContext)(mc.get(mc.SERVLET_CONTEXT));
  HttpServletRequest  request  =  (HttpServletRequest)(mc.get(mc.SERVLET_REQUEST));
  String remortAddress = request.getRemoteAddr();
  System.out.println(remortAddress);
  return webServiceTest.getServiceStr(str);
 }
}


Ïà¹ØÎĵµ£º

Thinking In Java Notes

1. ¶ÔÓÚÒ»¸östatic·½·¨¶øÑÔ£¬ÎÞ·¨·ÃÎÊ·ºÐÍÀàµÄÀàÐͲÎÊý£¬ËùÒÔ£¬Èç¹ûstatic·½·¨ÐèҪʹÓ÷ºÐÍÄÜÁ¦£¬¾Í±ØÐëʹÆä³ÉΪ·ºÐÍ·½·¨¡£
2. µ±Ê¹Ó÷ºÐÍÀàʱ£¬±ØÐëÔÚ´´½¨¶ÔÏóµÄʱºòÖƶ¨ÀàÐͲÎÊýµÄÖµ£¬¶øÊÇÓ÷ºÐÍ·½·¨µÄʱºò£¬Í¨³£²»±ØÖ¸¶¨²ÎÊýÀàÐÍ£¬ÒòΪ±àÒëÆ÷»áΪÎÒÃÇÕÒ³ö¾ßÌåµÄÀàÐÍ¡£Õâ³ÆΪÀàÐͲÎÊýÍƶϡ£ ......

javaÈëÃÅʵÀý classpathÓëpath ÉèÖÃ

JavaºÜÓÕÈË£¬µ«¶ÔÓÚ¸Õ¿çÈëJavaÃż÷µÄ³õѧÕßÀ´Ëµ£¬±àÒë²¢ÔËÐÐÒ»¸öÎޱȼòµ¥µÄJava³ÌÐò¼òÖ±¾ÍÊÇÒ»¸ö¶ñÃΡ£Ã÷Ã÷³ÌÐòû´í£¬µ«¸÷ÖÖ¸÷ÑùÈÃÈËÃþ²»×ÅÍ·ÄԵĴíÎóÐÅÏ¢ÕæµÄÈÃÄã°Ù˼²»µÃÆä½â£¬Ðí¶àÔÚJavaÃÅ¿ÚÅÇ»²Á˺ܾõijõѧÕß¾ÍÕâÑù·ÅÆúÁËѧϰJavaµÄ»ú»á£¬ºÜÊÇ¿Éϧ¡£±ÊÕßÒ²¾­Àú¹ýÕâ¸öÎÞ±ÈÍ´¿àµÄ½×¶Î£¬¸Ð¾õµ½±àÒëÄѵÄÎÊÌâ¾Í³öÔÚclasspat ......

JavaµÄdz¿½±´ºÍÉ±´(1)

 JavaµÄ¿½±´·ÖΪÉ±´ºÍdz¿½±´
dz¿½±´£º°ÑÒ»¸ö¶ÔÏóÖÐËùÓеķÇstatic³ÉÔ±±äÁ¿(°üÀ¨¶ÔÆäËü¶ÔÏóµÄÒýÓã¬javaÖеÄÒýÓÃÏ൱ÓÚC/C++ÖеÄÖ¸Õë±äÁ¿)¶¼¿½±´Ò»±é£¬¶ø²»¿½±´ÒýÓÃËùÖ¸ÏòµÄ¶ÔÏó
É±´£º°ÑÒ»¸ö¶ÔÏóÖÐËùÓеķÇstatic³ÉÔ±±äÁ¿(°üÀ¨¶ÔÆäËü¶ÔÏóµÄÒýÓÃ)¶¼¿½±´Ò»±é£¬ÒýÓÃËùÖ¸ÏòµÄ¶ÔÏóÒ²¿½±´Ò»·Ý
ÕâƪÎÄÕÂÏȽ²Êödz¿½±´£ ......

javaÖÐÈçºÎ°ÑÒ»¸öĿ¼ÏµÄÎļþÒƵ½ÁíÒ»¸öÖ¸¶¨Ä¿Â¼ÖÐ

 import java.io.*;
public class FileToFile
{
 public static void main(String[] args)
 {
   File fold = new File("e:\\java\\file.java");//ij·¾¶ÏµÄÎļþ
   String strNewPath = "e:\\java\\new file\\";//з¾¶
   File fnewpath = new File(strNewPath); ......

javaɾ³ýÎļþ¼Ð

    1. package book.io;  
   2.  
   3. import java.io.File;  
   4.  
   5. /** 
   6.  *  
   7.  * @author XWZ 
   8.  * 20 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ