term work

package org.dp.course.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
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.dp.database.DatebaseHandler;
import org.dp.wechat.pojo.ActionInfo;
import org.dp.wechat.pojo.CreateTicket;
import org.dp.wechat.pojo.Scene;
import org.dp.wechat.pojo.Ticket;
import org.dp.wechat.util.MessageUtil;
import org.dp.wechat.util.CommonUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;

/**
 * loginservlet
 *
 * @author DP
 *
 */
public class Ew extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		// super.doGet(req, resp);
		System.out.println("=========doGet========");
		this.doPost(req, resp);

	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse response)
			throws ServletException, IOException {

              System.out.println("d d");

			/*Ticket ticket = CommonUtil.getTicket(
					getticket("QR_SCENE",300, 1),
					CommonUtil.gettoken());
			String tk = ticket.getTicket();
			int es = ticket.getExpire_seconds();
			String url = ticket.getUrl();
			String stUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
					+ java.net.URLEncoder.encode(tk);*/
              String stUrl="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFK8DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL3kweXE0T3JscWY3UTltc3ZPMklvAAIEG9jUUgMECAcAAA%3d%3d";

			response.setContentType("text/xml; charset=UTF-8");
		     response.setCharacterEncoding("UTF-8");
		     response.setHeader("Cache-Control","no-cache");
		     StringBuffer sb = new StringBuffer();
		     PrintWriter out=response.getWriter();
			  sb.append("<img src=");
			 sb.append(stUrl);
			 sb.append("  height=200 width=200>");
			 out.println(sb.toString());
		     System.out.println(sb.toString());
		     out.close();

	}

	// 获取二维码凭证消息
	private static CreateTicket getticket(String action_name,
			int expire_seconds, int scene_id) {
		CreateTicket ct = new CreateTicket();
		ActionInfo ai = new ActionInfo();
		Scene sc = new Scene();
		sc.setScene_id(scene_id);
		ai.setScene(sc);
		ct.setAction_info(ai);
		ct.setAction_name(action_name);
		ct.setExpire_seconds(expire_seconds);
		return ct;
	}

}

  

时间: 2024-10-25 03:58:17

term work的相关文章

elasticsearch term match multi_match区别

转自:http://www.cnblogs.com/yjf512/p/4897294.html match 最简单的一个match例子: 查询和"我的宝马多少马力"这个查询语句匹配的文档. { "query": { "match": { "content" : { "query" : "我的宝马多少马力" } } } } 上面的查询匹配就会进行分词,比如"宝马多少马力"

长期演进技术(LTE,Long Term Evolution)

/********************************************************************************* * 长期演进技术(LTE,Long Term Evolution) * 声明: * 在对4G模块进行移植的过程中发现对一些各种通信标准不了解,移动.联通.电信 * 他们采用的通讯标准不同,比较郁闷的是,拿着移动的卡去测试只能识别电信的模块上, * 所以了解整个LTE的发展史就成了必要了. * * 2016-1-5 深圳 南山平山村

UVALive 6511 Term Project

Term Project Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVALive. Original ID: 651164-bit integer IO format: %lld      Java class name: Main 解题:强连通分量 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1

[再寄小读者之数学篇](2014-06-27 向量公式: The Hall term)

$$\bex \n\cdot{\bf b}=0\ra \n\times [(\n\times {\bf b})\times {\bf b}]=\n\times [\n\cdot ({\bf b}\otimes {\bf b})]. \eex$$ 证明: 右端第一个分量为 $$\beex \bea &\quad \sum_i \p_2(\p_i(b_ib_3))-\p_3(\p_i(b_ib_2))\\ &=\sum_i \p_2(b_i\p_ib_3)-\p_3(b_i\p_ib_2)\\

[Webpack 2] Hashing with Webpack for long term caching

Leveraging the browser cache is an important part of page load performance. A great way to utilize this cache is by versioning your resources. In this lesson, learn how to use Webpack’s hashing feature so you can take advantage of long term caching o

Lucene Query Term Weighting

方法 1 public static Query TermWeighting(Query tquery,Map<String,Float>term2weight){ 2 BooleanQuery nquery = new BooleanQuery(); 3 Set<Term> terms = new HashSet<Term>(); 4 tquery.extractTerms(terms); 5 for(Term itr : terms){ 6 float weight

Mac OS X下GnuPlot的安装和配置(无法set term png等图片输出)

今天使用gitstats分析git repo的活动信息,发现其内部使用gnuplot,结果发现无法生成png图片,进入gnuplot的shell发现无法设置png格式输出.如下 gnuplot> set term png ^ unknown or ambiguous terminal type; type just 'set terminal' for a list 或者类型别换成unknown 这是因为OS X 现在已经不预装X11了(见官方消息http://support.apple.com

Lucene 4.X 倒排索引原理与实现: (3) Term Dictionary和Index文件

我们来看最复杂的部分,就是Term Dictionary和Term Index文件,Term Dictionary文件的后缀名为tim,Term Index文件的后缀名是tip,格式如图所示. Term Dictionary文件首先是一个Header,接下来是PostingsHeader,这两个的格式一致,但是保存的是不同的信息.SkipInterval是跳跃表的跳的幅度,MaxSkipLevels是跳跃表的层数,SkipMinimun是应用跳跃表的最小倒排表长度,接下来就是Term的部分了.

ElasticSearch搜索term和terms的区别

今天同事使用ES查询印地语的文章.发现查询报错,查询语句和错误信息如下: 查询语句:{    "query":{        "bool":{            "must":[                {                    "range":{                        "update_time":{                            

Tera Term script for bootloader (uart)

Tera Term 是个超级终端, 自带TTL脚本,很方便定制操作流程, 如下实例是在串口端通过xmodem协议更新MCU固件. 几行代码 就能清晰的描述 一个繁琐的握手协议 并且 使用xmodem协议发送文件. 具体细节请看Tera Term安装目录下的help文档.