TA的每日心情 衰 2021-2-2 11:21
签到天数: 36 天
[LV.5]常住居民I
java 实现微信公众平台开发项目源码 6 Z/ C6 t7 K- P2 D' Q% m/ L" f/ L ~( U
本文向大家介绍使用Java来实现微信公共平台功能,实现根据回复的内容返回对应的消息。供大家学习使用。, d4 f7 x; o) q- }4 I
微信服务端收发消息接口:WechatServlet.java
4 q' }: A6 h. I, j3 P package demo.servlet;. Z( ^; g6 \. L; B( A o
% L3 c( w6 J6 n ]/ \6 t import java.io.BufferedReader;
0 h4 \2 I' v; A. m4 V6 v import java.io.IOException;
# o, h1 Z- u- B; r4 ^ import java.io.InputStream;; W4 h/ k. p' y8 H- S8 r0 _
import java.io.InputStreamReader;
/ d2 n3 T- ^4 O; L, Z; G6 j import java.util.Arrays;$ ?# `0 {0 h/ X* ?$ | C
5 b( n% I0 M2 y& m! y8 z7 d3 Z$ { import javax.servlet.ServletException;" W9 @1 E" P# f6 e# A( m
import javax.servlet.http.HttpServlet;1 F+ C; ?5 p3 @$ C
import javax.servlet.http.HttpServletRequest;( n* J; V$ ~5 o. I. G9 Q, H% C
import javax.servlet.http.HttpServletResponse;$ J& e6 `: i3 n$ M
1 ^6 O/ B% C, e: ~# h import demo.process.WechatProcess;$ q4 ?4 k6 x! k8 V3 W
import demo.util.SHA1;' @: V3 c& Y5 C% x$ ^1 f
/**: ]! b K: V" D7 P7 _
* 微信服务端收发消息接口$ w+ e6 M, A5 C8 j' g
*
3 d: } e* A2 n0 D * @author 科帮网
% L! F( p7 C h * 0 e" W0 J: Z( S+ f
*/
; P+ Y& m! a* w @SuppressWarnings("serial")
. Y* \; L) E4 V$ ` public class WechatServlet extends HttpServlet {+ f% o+ M; u. x
# W4 S1 h- o8 L% r/ e5 K // 自定义 token2 r4 {& ?! f7 _/ b7 g
private String TOKEN = "52itstyle"; ) g+ f7 O2 t2 E; o5 }0 R3 d
public void doGet(HttpServletRequest request, HttpServletResponse response)' l& Z/ r* o7 ~+ }9 c0 D9 s3 f
throws ServletException, IOException {7 ?+ t0 Z( t" a7 U! k
String signature = request.getParameter("signature"); // 随机字符串
/ N( _/ u1 L% W$ V3 r N String echostr = request.getParameter("echostr"); // 时间戳6 z2 ?6 R5 z1 Y& e. R0 L
String timestamp = request.getParameter("timestamp"); // 随机数
5 t7 _+ D! z' q) T String nonce = request.getParameter("nonce");
M+ Q6 s5 J, f1 \6 z7 L; C
5 C. p* ]$ Q( w5 n) [+ z- H String[] str = { TOKEN, timestamp, nonce };2 i" K) ^+ m" ?
Arrays.sort(str); // 字典序排序
1 O( G+ R9 H# L String bigStr = str[0] + str[1] + str[2]; // SHA1加密. K) u3 `7 I6 [" o
String digest = new SHA1().getDigestOfString(bigStr.getBytes()).toLowerCase();
3 n2 r O; B" i // 确认请求来至微信& j# L2 P0 u; i& c- K/ i
if (digest.equals(signature)) {' m* V3 P8 {: L5 p3 Y' }6 X
request.setCharacterEncoding("UTF-8");
* i- e4 M% D. d* ^$ H! f response.setCharacterEncoding("UTF-8");
2 r* V4 g: W; s0 |2 \' L
9 b$ w8 Y r1 m7 t /** 读取接收到的xml消息 */3 l; T) X6 M8 z: z/ A! M5 G3 u
StringBuffer sb = new StringBuffer();1 G9 m# E3 G, j
InputStream is = request.getInputStream();
* o, b: Y" E' }/ u- F8 y* e InputStreamReader isr = new InputStreamReader(is, "UTF-8");
7 _2 w" B: C. j: O; Q BufferedReader br = new BufferedReader(isr);( \0 `; |* \; J Y
String s = "";8 n. Z( f) w) F
while ((s = br.readLine()) != null) {
" E( I$ E5 V3 F6 j. F' S) F sb.append(s);( `& x8 w; _+ c* b
}: M) h, o2 v7 W6 E
String xml = sb.toString(); //次即为接收到微信端发送过来的xml数据% I" P" M1 O$ U, o5 y
Q8 J9 \( A" S% F9 T) q0 e) y' `" R String result = "";. T7 i, i- A- c
/** 判断是否是微信接入激活验证,只有首次接入验证时才会收到echostr参数,此时需要把它直接返回 */
+ T$ [! f$ q' n' P4 g; c# k4 Q if (echostr != null && echostr.length() > 1) {
. e. k( I1 A W# B4 a- n result = echostr;5 E, o+ m; K0 v: b, S6 L
} else {
& P9 S& p0 S5 j3 ^7 A //正常的微信处理流程
9 P0 j' \ u/ n result = new WechatProcess().processWechatMag(xml);2 O/ x. b4 ?; x( h8 \
}
: U6 _/ @" N) e2 V7 s System.out.println("说的什么"+result);
# g$ Y" \# F1 e. T; n response.getWriter().print(result);
' K7 n T- [4 `+ R }$ h! D0 x4 p, V. ]$ P' i/ \' K7 ?
}& s5 d" N* X: ^# Z3 l3 j; d
; S3 M8 a' v V/ J7 K /**
; \0 [3 I6 u5 y3 n4 \4 w * The doPost method of the servlet. <br>
2 a c" Q! Z- ~% d6 K *
/ g9 L' C8 I( f7 }2 X * This method is called when a form has its tag value method equals to
: X1 W+ ^( [% C * post.
* O: g l) b. B5 P3 p8 T/ o * ( T, G$ |0 T' z0 p
* @param request2 s) x9 P& ?/ r7 R: C& j$ y5 [) G
* the request send by the client to the server5 A* f/ F6 F/ E! c! ?
* @param response: r" K: G6 s& g2 K3 [
* the response send by the server to the client
* x6 Z9 [6 I T1 T0 Y3 O * @throws ServletException: y) n; K; c; C8 v* W
* if an error occurred3 g* o) f4 A, }
* @throws IOException
/ H" ~2 d2 B* w2 c1 z0 K5 A9 [8 j * if an error occurred4 i- j, M5 H5 C( I# d- K
*/
+ @4 F1 u9 N- m public void doPost(HttpServletRequest request, HttpServletResponse response)
g7 I7 u4 d6 ~- F) t throws ServletException, IOException {0 V: w: w$ G0 w( }
doGet(request, response);
9 P. m) w' U1 O# H8 O# s }: _4 R8 J$ T" f9 v9 w. x4 |6 w
# f- u- P( T- t0 g# f7 |& K7 T5 Y% _
}
; w6 A* R: |, F" D/ M 复制代码 接收到的微信xml实体类:ReceiveXmlEntity.java8 c+ i* L0 T k9 Z2 z4 k# T
package demo.entity;; k6 c) n' a/ y8 s \) R
/**9 p j$ @# w7 L. v/ y# r
* 接收到的微信xml实体类
6 t# C! @3 P+ H: }6 e ~ * @author 科帮网
; s. d) Q. M5 Q [. P, j* M/ \2 t *
3 a0 U2 c2 D3 P* e& G3 f- V */, {' \# H8 {5 |# C7 H" K9 M# R. }" O* p/ ~
public class ReceiveXmlEntity {
* E! Z7 b* {4 ?# i, V private String ToUserName="";0 c1 N' i) ^- c% y1 i# g
private String FromUserName="";0 Q! b n' K) @2 |2 N E$ q) U
private String CreateTime="";- L. d# e3 r4 O G ?" E8 K* x
private String MsgType="";
) T+ U, i3 j+ ?" E9 Q o private String MsgId="";) |8 @ [4 G8 `" P3 ]% s
private String Event="";: I7 ]! V+ U6 ]& N! a" `' X* S4 c; L
private String EventKey="";+ H1 ?% G+ L; R. c! i
private String Ticket="";
6 v# N' {0 b4 f9 } private String Latitude="";
9 C; {. ^; d. ?1 I private String Longitude="";
9 d( G" s4 v, F& R8 E5 o0 g private String Precision="";
0 j2 r \3 F! r+ ^ private String PicUrl="";
+ N0 v6 B6 N# |) a6 e private String MediaId="";
' B( M$ I- r% E& `6 l# U3 L private String Title="";
- s! R+ Q8 c1 a6 d% ]) I. }: G) V private String Description="";
7 i }% L* c# h0 l& K private String Url="";
9 F! A) _# D# F* J# R* ]% ] private String Location_X="";
; H8 l) V) f& w3 y/ R7 ~ private String Location_Y="";$ S9 }- F+ x: |
private String Scale="";
5 A9 o- _( c/ i private String Label="";8 N* f8 c. F+ R# U2 O1 G" }+ n1 u# P
private String Content="";' E; b+ L% P5 Y6 K, Q
private String Format="";
2 H$ L& z) F5 U1 l$ { private String Recognition="";+ p+ v. v$ \$ K7 E( ^, a$ P
( I6 Z) l! ]: t& Y% x
public String getRecognition() {' Q1 P0 s- o1 r5 Z
return Recognition;
8 s2 c& w/ g& \% g7 a. X3 k }
; N. T4 X& x/ l# d" b! R public void setRecognition(String recognition) {" G1 N& M0 W* |8 L' Y3 X! P9 j
Recognition = recognition;
* a6 M D, [) N" h' i: ^1 e: N }
% t5 v; U" |. s7 R: M N: Q4 b public String getFormat() {
5 v3 [) ]: s" X- S+ \" y return Format;# k Z& K/ f5 v6 T: P/ @1 P# }
}6 c9 C7 |! u- \7 C' u3 V2 I$ u/ w
public void setFormat(String format) {
- W/ S7 A0 p' w$ u# w9 H9 t* j Format = format;' F8 y; n) ?6 q3 J: R
}
: {$ ~% ?; D0 |& n6 F, M; U: ~ public String getContent() {
. c% Y( w$ g5 k7 y/ ? return Content;4 G6 x- ]+ E6 u. R) h% P6 C
}
7 C2 V! Y& P0 U% O public void setContent(String content) {2 T4 f7 d+ J" h' G3 k
Content = content;
$ ^/ K) _ L) R8 y( q% K, j) ] }2 p* k* Q+ t# y) H$ H. E# {
public String getLocation_X() {
) X7 r" E& \- Q w2 V return Location_X;
( |% S9 \# S. x/ H( b9 ~ } M; r6 J1 h- M3 @+ x' X9 p! l
public void setLocation_X(String locationX) {
% V" B |1 G6 x6 p/ P( L3 N Location_X = locationX;
- ^3 e% _' R* m } I2 |7 j1 @- j2 c0 n; z6 x! }
public String getLocation_Y() {, o" m2 U2 {& H: \# m; X
return Location_Y;
: N3 m# ^) q7 j0 k; T& A+ I/ V }" e+ C1 E4 v* J
public void setLocation_Y(String locationY) {
/ |1 y/ f/ N* S/ M7 A Location_Y = locationY;( \$ W$ \: p) l! E
}! N c9 m' r {/ ]
public String getScale() {8 l+ p0 q5 n2 T0 m7 T
return Scale;0 Y; W9 C5 n. i0 d9 J$ g
}) V4 e7 C- q* j/ L% e5 h2 I; i4 a
public void setScale(String scale) {
0 {" W/ ]! F& b4 H5 m Scale = scale;
( X. I* f+ S& z" c6 D6 E, i( z }5 f& m. ~. q2 \! V) d+ W8 a
public String getLabel() {
+ l4 n3 V( j6 Y' @: a5 ^- E return Label;+ ^9 Z' Y2 w. j5 p5 n3 h7 g
}
3 D7 Y/ H3 w5 q6 j3 s9 p: E7 f public void setLabel(String label) {
) s8 ?! d5 P* e0 M Label = label;
$ w/ p6 F j* p5 K* {- [6 s- }. X }: c1 B* L, E+ \" Z$ J8 z6 q
public String getTitle() {
) h/ e7 j3 [9 s4 r3 ]4 m/ O; a. I return Title;
/ a$ [0 A$ i8 k: Q% \& L. b }" x) G# w' K9 A _1 D* `
public void setTitle(String title) {# K2 {6 o) y h! e) G& ^" m
Title = title;
3 c {9 T; n0 {) j; g" n* R6 M5 K }
X: e7 S' G5 k! p- I' x! r) |2 V public String getDescription() {4 R9 _" Z# P8 F( W2 p& ?+ Z" U
return Description;7 x* z' O8 P* m6 v. Z. b' H# x
}1 Z; c2 \0 U. z; T n* P8 Q
public void setDescription(String description) {4 o. K" s$ S b! P
Description = description;
3 w9 e! A' x1 k( S2 ^ }
! |, b2 h; \* g' l* V1 `% W; G public String getUrl() {5 S0 _6 t2 n2 v
return Url;
+ P7 P. \3 ^% f0 R) } }
0 X% i* L0 o0 M3 e+ M! n0 U k) K public void setUrl(String url) {
) _5 U! h8 c* V$ w0 q: p: k Url = url;
0 Z( J" l7 E) `3 l }
$ Y/ b- X) _% c. ~8 X public String getPicUrl() {: H+ L$ o, P$ E: q" d; j$ A0 ~
return PicUrl;% `2 x5 _- o: u8 y' H& w: R
}
: Q5 c& p" u) z$ O: m- d public void setPicUrl(String picUrl) {
0 O8 @& {" D5 I) W" G PicUrl = picUrl;
8 M) s( _- c; B& g8 b }) g2 A! M, O) {7 R: m5 D
public String getMediaId() {; k8 l: `- l+ N
return MediaId;& r9 P6 P/ R# {, Y. ^- N4 J6 E, h
}$ R5 ^% L, C1 g+ f1 I& l
public void setMediaId(String mediaId) {
) b8 Z- w* \8 ^! t MediaId = mediaId;1 v$ H$ x& i7 k* p6 C `
}
: q S2 l' H4 @" z9 ^8 q/ J public String getEventKey() {! N' `; I7 ~( B% n0 A6 m. n
return EventKey;4 d) W/ E9 L3 x, A( D6 Z
}( a, c& j) s4 v. C
public void setEventKey(String eventKey) {. I u) L. I3 T+ C/ U/ \4 H# U
EventKey = eventKey;
( G- o( X" r: @# a7 r8 g }
( ?$ }; w- |9 ^* W7 a/ d z public String getTicket() {
* t) z, j2 T2 l* Q; v( x return Ticket;6 Z2 E7 J3 |2 K, m+ T( n
}. f, _0 J7 \6 M# A& u
public void setTicket(String ticket) {3 Z/ m7 y& i# [# S+ B
Ticket = ticket;
! [7 Y0 _5 }( \; p% W9 Q0 W }
* J1 y1 C8 a) B7 T public String getLatitude() {. s4 i6 j, L5 G% H
return Latitude;
6 K# C3 F& W% a0 P3 @8 v) O/ D$ ^ }
2 [* H2 s3 C3 c" T0 { public void setLatitude(String latitude) {
5 u5 u/ B$ D9 G. R7 t* H Latitude = latitude;7 O, w a: K, E6 V1 m
}/ `% a. F9 D# k" C2 Z7 ^
public String getLongitude() {4 {0 M; d$ i" u- P1 u0 a6 Q
return Longitude;. U- U4 \2 l9 v }
}+ t [& H: I& V" p
public void setLongitude(String longitude) {
' ~% Y+ @' Q7 N7 b0 N7 U Longitude = longitude;" X0 M$ _+ R" `7 v* O& q( I. o
}0 Q; w, G8 X6 z8 I# W/ b* J5 }
public String getPrecision() {
6 Q+ s$ X B0 i9 c4 x; K, n return Precision;; J+ W, u4 M, U" E
}
7 E6 o8 A9 Q& ~3 S" e' k B& \ public void setPrecision(String precision) {: e4 c% ]4 t6 |1 W; r4 n. _
Precision = precision;% y5 k" i5 O B6 J" F
}+ S( [, w P% C0 I* r
public String getEvent() {! ]) x- W% k% x1 o+ B
return Event;
1 ?, H1 u* `3 |: C* ~# A }
; f; ^9 N6 s8 m4 J2 Z' W; r public void setEvent(String event) {
2 c% B) i8 l3 U Event = event;* v8 {9 l; D3 O% o: G: [0 k" e6 [* [
}
. _( i0 W* y% A' N public String getMsgId() {1 I. F: D. F/ Y- M
return MsgId;) j" J# a' q. F' Q# o @% F- ^
}
/ w! z3 G5 P- E$ M. x( Y5 _1 b public void setMsgId(String msgId) {7 o: G7 q' @7 o- j: b% E+ F4 r
MsgId = msgId;
8 e% S# u5 m& g' n; B7 \ }! Q( u- `2 x z) v' F
public String getToUserName() {# [: J2 H: G' U+ Q
return ToUserName;
" b5 W6 H" O# z2 r }
" q* @4 ~% [8 M5 l& W/ K9 L2 K public void setToUserName(String toUserName) {- `. i6 B% `3 o! l4 `( M3 d- C
ToUserName = toUserName;
: b# \2 D0 U3 h" w' O p }* i$ v8 }' E$ V$ s$ O0 ^
public String getFromUserName() {( [ I8 U" F% J4 q( G6 l
return FromUserName;
5 Y/ P; b' ]: H& s) c }
- }% E! o9 ?: p1 }# @5 \* n public void setFromUserName(String fromUserName) {
! f* S0 P# c9 d$ J0 A- f FromUserName = fromUserName;" s g+ {5 v+ S z- `8 X
}1 g( \/ d; s% B, H
public String getCreateTime() {) v7 p. f6 @. B: a* d
return CreateTime;
- t1 ` P1 a* S" C" Y6 A- r }
: @% D, k v* d- z6 z public void setCreateTime(String createTime) {
( U9 ]6 M0 M- m2 ]3 { CreateTime = createTime;( \& O0 m; p B* R
}
( [# b4 @# P/ h d* {! N public String getMsgType() {- C8 }7 A8 t8 d) p2 A; ?
return MsgType;" A8 g! i) H+ P k
}
J' x# t4 ?$ R$ [8 y; I ^. Y0 y& X' ] public void setMsgType(String msgType) {
: s# t% H, c! U( I3 V* A2 ~& M MsgType = msgType;# n; f5 m" T0 g" `7 ]+ L
}
: W e0 k9 U ]. q! y9 l4 B }
, C6 `+ D5 T2 m* Y 复制代码 调用图灵机器人api接口,获取智能回复内容 TulingApiProcess.java! r/ S! l& Z! u, o+ ^
2 l# g3 P9 o/ x- X
package demo.process;0 P f3 T: U$ A4 v4 p
; w# i% c( G6 N6 h" }0 U$ B. Y import java.io.IOException;: t) R2 X! l: W: X
import java.io.UnsupportedEncodingException;/ a. N0 @' z: L+ Y4 [
import java.net.URLEncoder;% n9 n6 h) H1 V- m
5 S* _' t, F9 l
import org.apache.http.HttpResponse;6 H% k O2 N( ]1 v+ n, H/ Q
import org.apache.http.client.ClientProtocolException;3 s2 \) P- p- w1 `3 x+ b
import org.apache.http.client.methods.HttpGet;/ Y2 C; U, Y8 _8 V/ U/ G; [
import org.apache.http.impl.client.HttpClients;- R. O3 z) W: |+ i5 `
import org.apache.http.util.EntityUtils;
2 Q, N% I c( I+ A5 b* T! e) M- W' x import org.json.JSONException;
/ z' t C* }. f' i( Z) Z import org.json.JSONObject;
( F( B; O/ N. l, D' n! `5 O9 O* o% J
& e5 e5 m# S* R( l /**& |1 H; b1 R6 e% a
* 调用图灵机器人api接口,获取智能回复内容5 D1 \0 p; A% |, r0 m2 P
* @author 科帮网7 Z5 e1 g; S( n/ ?- V, H' A
*( F1 \6 l0 v1 K$ a, F" c5 Y
*/8 s8 A* |: U, X& q* e* R0 x3 Y7 U
public class TulingApiProcess {+ b5 u7 X$ ~# l, h5 x
/**0 ?) P, k9 N& m: h9 Y
* 调用图灵机器人api接口,获取智能回复内容,解析获取自己所需结果
* _ @) d, G k5 G' k * @param content
4 f+ z9 Q: i2 N) s( C/ ~ * @return* D( R1 o- {3 A$ W# K9 z/ ]
*/
# C5 O4 d# f& H public String getTulingResult(String content){0 b/ @1 ]- y. d' j9 M
/** 此处为图灵api接口,参数key需要自己去注册申请 */
& |3 x$ v. X4 }4 p String apiUrl = "http://www.tuling123.com/openapi/api?key=2a31b2f601f74b54ea13db1c82fe5d71&info=";
6 L: }9 b) s' o String param = "";
3 B7 l9 a, z/ D7 H& W try {7 l1 ^0 ~2 O+ x4 S- ]" C5 I# Z
param = apiUrl+URLEncoder.encode(content,"utf-8");, G: f b7 s2 y) B
} catch (UnsupportedEncodingException e1) {
# U: g2 M* ~* M) u! c2 \ e1.printStackTrace();
2 I. n' h% ^9 F& @: A } //将参数转为url编码: O* T! ?0 G1 y2 G
/** 发送httpget请求 */; ?; \% L! }5 g
HttpGet request = new HttpGet(param);
, i7 h# R, Y; b* J# r* Y* _ String result = "";3 c! j; p1 l. y* ~9 {6 ^* ]. z
try {
+ `" I1 O% H ]9 C6 j7 @9 \ HttpResponse response = HttpClients.createDefault().execute(request);8 N: H4 r- \4 X; r& I! V4 N
if(response.getStatusLine().getStatusCode()==200){
3 Y( U# V% H- N$ t3 |( X0 R result = EntityUtils.toString(response.getEntity());2 f0 [. g; q8 @8 k
}2 m2 V9 B. O& [. e8 g: Q L
} catch (ClientProtocolException e) {7 e& D* O! ^6 v; m% [( \
e.printStackTrace();
$ g' Y/ M! _8 m7 k g/ O! j4 x; B } catch (IOException e) {# S: ]! }7 [+ [2 _3 R. \, G$ |
e.printStackTrace();
9 K0 P! ^( X, L }
7 D ]. E" d6 Y /** 请求失败处理 */; ?* M {9 i3 R( Z) @. G: B- t
if(null==result){
! u- _( T, ^9 b8 O3 F* [ return "对不起,你说的话真是太高深了……";3 v, J- N5 U7 @ G
}
. _; B9 @# ^+ U U
' w# G2 |, g( R0 L" c try {
, W$ X' F4 ~, F! D JSONObject json = new JSONObject(result);
- H( s$ D7 a0 |+ k1 K3 v2 ] //以code=100000为例,参考图灵机器人api文档+ q0 b0 `# H# E* \# ]( p1 |
if(100000==json.getInt("code")){
, C j& u, K) @4 M0 h result = json.getString("text");
4 S/ X* k5 Z5 Z& c2 u; C }; Z, H1 R" R5 o% u! {4 @
} catch (JSONException e) {( c! ^% c" ^1 Y8 \& R
e.printStackTrace();+ e; `8 r0 Y5 g
}0 ^; v, C1 P$ _: Y c3 h! p
return result;
, r5 k( u$ |9 S }
! l" M/ y# c1 M, _/ L' F }. @! c! N& z5 Y& M
复制代码 : }- `1 ~3 B% c* l
web.xml 配置:! j5 A: g. ?0 A3 o2 I
<?xml version="1.0" encoding="UTF-8"?>% l8 r. _9 U# B0 U* T/ T
<web-app version="2.5"
& n. @3 b9 i/ j6 d5 S2 n xmlns="http://java.sun.com/xml/ns/javaee" / I* d" v$ }3 a6 q4 _
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8 B/ ~% u9 n. K- C6 c) o xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
3 P. r9 c0 j7 G/ `4 }. P9 E http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
% O' A5 T' q6 D2 W( A3 S <servlet>
$ Y$ B6 n9 t( N: V <servlet-name>WechatServlet</servlet-name>8 z* }0 w* F) j+ u X
<servlet-class>demo.servlet.WechatServlet</servlet-class>
: H t O) t7 K" |! _ </servlet>2 O& j$ I1 g+ D) x$ a$ y+ z
8 ^; r8 ~* ~4 n y p0 t1 X, q <servlet-mapping>
* d3 e L0 x |+ `" o; s <servlet-name>WechatServlet</servlet-name>
$ W; v+ @: e5 g8 c# b. C4 m$ F, |7 A <url-pattern>/wechat.do</url-pattern>
0 r( U1 g: a5 n/ F( ?" C* F </servlet-mapping>
$ |9 O: w2 a8 k3 e <welcome-file-list>6 J7 G' U; B1 Y; d" k
<welcome-file>index.jsp</welcome-file>" \( t2 K- w" X+ N) f8 ^
</welcome-file-list>
: k% E& c# F$ e2 A$ w </web-app>/ Q+ {5 H4 Y) Q1 v) U K
复制代码
9 h8 P2 Z% `' V9 D0 \ 项目源码下载地址:
& w* K! k* |, w# z1 Y7 x
0 z4 Y w* D- `& G3 Z
* b( @6 @5 B7 v* u3 _ `7 P
科帮网-Java论坛、Java社区、JavaWeb毕业设计 1、本主题所有言论和图片纯属会员个人意见,与本社区立场无关2、本站所有主题由该帖子作者发表,该帖子作者与科帮网-Java论坛、Java社区、JavaWeb毕业设计 享有帖子相关版权3、其他单位或个人使用、转载或引用本文时必须同时征得该帖子作者和科帮网-Java论坛、Java社区、JavaWeb毕业设计 的同意4、帖子作者须承担一切因本文发表而直接或间接导致的民事或刑事法律责任5、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责6、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意7、科帮网-Java论坛、Java社区、JavaWeb毕业设计 管理员和版主有权不事先通知发贴者而删除本文
JAVA爱好者①群:
JAVA爱好者②群:
JAVA爱好者③ :