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() {
相关文档:
使用dom4j解析XML时,要快速获取某个节点的数据,使用XPath是个不错的方法,dom4j的快速手册里也建议使用这种方式,标题都写的这么阔气:Powerful Navigation with XPath,呵呵。
方法是使用Document的selectNodes(String XPath)方法,代码写法:
List l = doc.selectNodes("//COLS/COL1");
执行时却抛出以下异常:
Exc ......
xml
<mime>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009101410241364.txt</text>
</content>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009 ......
当输入 》时自动补全 当输入《/时自动补全
“=================================
" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <di ......
问题描述:
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 ......