易截截图软件、单文件、免安装、纯绿色、仅160KB

socket, nio socket,及xml传递object 方法

1:如何通过socket代理来访问服务端:
String proxyHost = 
"192.168.204.212"
;   

String proxyPort = 
"1080"
;   

  

//通知Java要通过代理进行连接。
正在装载数据……
  

System.getProperties().put(
"socksProxySet"
,
"true"
);   

//指定代理所在的机器
  

System.getProperties().put(
"socksProxyHost"
,proxyHost);   

//指定代理监听的端口。
  

System.getProperties().put(
"socksProxyPort"
,proxyPort);    

  

String host = 
"134.01.69.80"
;   

int
 port = 
12086
;   

System.out.println(
"connetioning:"
 + host + 
":"
 + port);   

server = 
new
 Socket(host, port);  

二:老socket传递Object对象:
要传递的对象:
public
 
class
 Employee 
implements
 Serializable {    

  

       
private
 
int
 employeeNumber;    

       
private
 String employeeName;    

  

       Employee(
int
 num, String name) {    

          employeeNumber = num;    

          employeeName= name;    

       }    

  

        
public
 
int
 getEmployeeNumber() {    

      


相关文档:

JAVA读XML:sax,dom,jdom,dom4j的比较以及选择(转)

JAVA读XML:sax,dom,jdom,dom4j的比较以及选择(转)
原文:www.hicourt.gov.cn/homepage/show9_content.asp
SAX:                                 ......

SAX解析XML(源代码)

package book.xml;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.Default ......

java 操作XML文件(片段)

//create a new Document
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.newDocument();

//add root Node
Element noteuser = d.createElement("note-users");
d.appendChil ......

XML数据岛技术的总结

  最近做的一个项目中运用 xml 数据岛技术,所以把数据岛方面的知识总结一下。
  XML 数据岛 ( data islands )就是被 html 页面引用或者包含的 xml 数据,是从 IE5 开始引入的一项技术。可以通过 xml 标签很轻松将数据岛插入到 html 文档中。那么怎么访问 xml 数据岛的数据呢,很简单,通过 xml 的 id 。在页 ......

spring xercesImpl xml 解析问题

问题描述:
   jboss应用服务器,使用spring 
   无法启动服务,错误日志:
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@155d3a3] does not
support XML Schema. Are you running on Java 1.4 or below with Apache
Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号