package com.Cherie.server;
import java.io.*;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class loadMessage extends HttpServlet {
/**
* Constructor of the object.
*/
public loadMessage() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.print("使用post方法访问服务器成功!");
System.out.println("访问成功");
String type = request.getParameter("type");//获取访问信息类型,0 授权信息,1 刷卡信息
if(type.equals("0")){
System.out.println("开始处理授权信息……");
String seatId = request.getParameter("seatId");
System.out.println(seatId);
SignAuthAction saa = new SignAuthAction();
String jsonstr = saa.test();
out.print(jsonstr);
}else if(type.equals("1")){
System.out.println("开始处理签入信息……");
/*BufferedReader br=new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
System.out.println(br);*/
}else if(type.equals("2")){
System.out.println("开始处理签出信息……");
}
out.flush();
out.close();
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
sign.rar (25个子文件)
sign
.project 1KB
src
com
Cherie
server
loadMessage.java 3KB
SignAuthAction.java 1KB
signAuth.java 1KB
WebRoot
WEB-INF
classes
com
Cherie
server
loadMessage.class 2KB
signAuth.class 2KB
SignAuthAction.class 1KB
lib
ezmorph.jar 84KB
json-lib-2.2.2-jdk15.jar 141KB
jstl-impl.jar 379KB
commons-logging-1.1.1.jar 59KB
javax.servlet.jsp.jstl.jar 44KB
commons-lang.jar 203KB
commons-beanutils-1.7.jar 184KB
commons-collections.jar 558KB
web.xml 731B
index.jsp 829B
META-INF
MANIFEST.MF 39B
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.common.project.facet.core.xml 414B
org.eclipse.jdt.core.prefs 364B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.component 471B
.jsdtscope 522B
.classpath 2KB
共 25 条
- 1
资源评论
- Goahead_fire2017-11-10都没有安卓端
Cherie-S
- 粉丝: 2
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功