package org.marker.weixin.test;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.Writer;import java.util.ArrayList;import java.util.Collections;import java.util.Date;import java.util.List;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * 处理微信服务器请求的Servlet URL地址:http://xxx/weixin/dealwith.do * * @author marker * @blog www.yl-blog.com * @weibo , 2014-09-11 */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.info("收到POST请求:"+(new Date())); request.setCharacterEncoding("utf-8"); response.setContentType("text/html; charset=utf-8"); InputStream is = request.getInputStream(); OutputStream os = response.getOutputStream(); //TODO:写微信平台推送过来的各种信息的处理逻辑 }}
二、微信网站的测试主页效果及代码,借助bootstrap,支持媒体查询,当手机水平看时,栏目会变成2*2布局,index.jsp,需要JSTL的支持,也可以自行去掉,不影响效果,注意连接文件的路径即可
以上就是JAVA微信开发总结的图文代码分享的详细内容,更多请关注php中文网其它相关文章!