首页>代码>ExtJS4.2.1 MVC登录小示例,不带数据库,静态判定>/MVC/src/com/proj/Crm/servlet/LoginServlet.java
package com.proj.Crm.servlet;

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 LoginServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public LoginServlet() {
		super();
	}

	public void destroy() {
		super.destroy();
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		PrintWriter out = response.getWriter();

		String branchid = request.getParameter("branchid");
		String password = request.getParameter("password");

		if ("admin".equals(branchid) && "123456".equals(password)) {
			out.write("{success:true,message:'登录认证成功'}");
		} else {
			out.write("{success:false,message:'登录认证失败'}");
		}
		out.flush();
		out.close();
	}
}
最近下载更多
1420568818  LV7 2021年6月18日
CoderMars  LV13 2020年11月27日
assadd  LV9 2020年7月16日
洛斯里克特的灰烬  LV4 2020年3月13日
jaonsang  LV25 2020年1月26日
hey_two  LV3 2019年11月14日
gongxiao45  LV2 2019年9月16日
云梦溪网络  LV3 2019年5月23日
yncxlk  LV7 2019年4月11日
zbchen2008  LV6 2019年2月8日
最近浏览更多
暂无贡献等级
yu1999104  LV1 2022年12月10日
微信网友_6191703145451520  LV1 2022年10月27日
492537243 2022年10月17日
暂无贡献等级
是你爸爸啊100  LV5 2022年7月30日
沉沦12345  LV1 2022年4月30日
1306878374  LV13 2021年12月27日
13250241596  LV3 2021年12月22日
盆盆  LV3 2021年7月25日
duwanfa  LV3 2021年6月12日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友