big update:去除被动消息实体、commons包、dom4j包
This commit is contained in:
+1
-1
@@ -130,7 +130,7 @@ public final class WeixinServerBootstrap {
|
||||
new WeixinServerInitializer(aesToken,
|
||||
messageDispatcher));
|
||||
Channel ch = b.bind(serverPort).sync().channel();
|
||||
System.err.println("weixin server startup OK:" + serverPort);
|
||||
System.err.println("weixin4j server startup OK:" + serverPort);
|
||||
ch.closeFuture().sync();
|
||||
} catch (WeixinException e) {
|
||||
throw e;
|
||||
|
||||
@@ -16,32 +16,28 @@ public class EncryptMessageHandler extends DefaultHandler {
|
||||
|
||||
private String encryptContent;
|
||||
|
||||
private String currentQName;
|
||||
|
||||
@Override
|
||||
public void startDocument() throws SAXException {
|
||||
encryptContent = null;
|
||||
currentQName = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String qName,
|
||||
Attributes attributes) throws SAXException {
|
||||
this.currentQName = qName;
|
||||
if (qName.equalsIgnoreCase("encrypt")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(String uri, String localName, String qName)
|
||||
throws SAXException {
|
||||
this.currentQName = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
if (currentQName.equalsIgnoreCase("encrypt")) {
|
||||
this.encryptContent = new String(ch, start, length);
|
||||
}
|
||||
}
|
||||
|
||||
public String getEncryptContent() {
|
||||
|
||||
Reference in New Issue
Block a user