日期:2014-05-18 浏览次数:20681 次
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/xml;charset=utf-8");
PrintWriter out = response.getWriter();
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
//获取url地址传来的参数
String account=request.getParameter("account");
String password=request.getParameter("password");
System.out.println("status cha kan");
out.println("<?xml version='1.0' encoding='utf-8' ?><returnsms>");
//输出返回的接收状态信息
if(!(null==account||null==password))
{
if(!("".equals(account)||"".equals(password)))
{
//解码
account=URLDecoder.decode(new String(account.getBytes("ISO-8859-1"),"utf-8"),"utf-8");
password=URLDecoder.decode(new String(password.getBytes("ISO-8859-1"),"utf-8"),"utf-8");
//判断用户名密码
if(account.equals("qq")&&password.equals("123"))
{
MessageEntity me=new MessageEntity();
if(!AllLinkedList.phoneReciveLink.isEmpty())
{
AllLinkedList.prsize=AllLinkedList.phoneReciveLink.size();
for (int j = 0; j < AllLinkedList.prsize; j++) {
me=AllLinkedList.phoneReciveLink.removeFirst();
out.println("<statusbox>");
out.println("<mobile>"+me.getBSenderMDN().trim()+"</mobile>");
out.println("<taskid>"+me.getBsmsID()+"</taskid>");
if(me.getBsmsResult().equals("000"))
{
out.println("<status>10</status>");