package dp.admin.svlt; 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; import javax.servlet.http.HttpSession; import dp.utils.HandleProperties; import net.sf.json.JSONObject; public class CkSvlt extends HttpServlet { /** * Constructor of the object. */ public CkSvlt() { 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 { this.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 { //设置传输数据编码方式 request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html"); HttpSession session=request.getSession(); //获取使用者信息 Object userid=session.getAttribute("userid"); Object utype=session.getAttribute("utype"); //创建json对象 JSONObject json=new JSONObject(); String sql=request.getParameter("sql"); if(userid==null||utype==null){ json.put("msg", "请重新登陆"); }else{ HandleProperties hp=new HandleProperties(session,utype+""+userid); hp.setValue("sql", sql); json.put("msg", 1); } PrintWriter out=response.getWriter(); out.print(json.toString()); out.flush(); out.close(); } /** * Initialization of the servlet. <br> * * @throws ServletException if an error occurs */ public void init() throws ServletException { // Put your code here } }
最近下载更多
pangzhihui LV12
2月22日
2244193927 LV1
2023年12月26日
天下第一无双 LV1
2023年12月10日
陈继先 LV1
2023年11月13日
Palpitatel LV1
2023年11月7日
oebeuendbhs LV1
2023年10月1日
寒江雪2017 LV9
2023年8月2日
jikdhdd LV1
2023年6月28日
dufeng LV1
2023年5月12日
qiuqiuqiu111 LV4
2023年4月21日
最近浏览更多
pangzhihui LV12
2月21日
晴曛 LV6
2月20日
欧豆豆
1月10日
暂无贡献等级
mcszy571
1月1日
暂无贡献等级
小居居 LV1
2023年12月31日
asddwh LV12
2023年12月29日
susitian LV2
2023年12月27日
2244193927 LV1
2023年12月26日
yuye122333 LV1
2023年12月26日
z132333
2023年12月23日
暂无贡献等级