⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 j2ee编程技术中的一些代码
💻 JAVA
字号:
/*
 * Created on 2004-6-13
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author haoyulong
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class Main extends HttpServlet {
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		//TODO Method stub generated by Lomboz
		doPost(request,response);
	}
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		//TODO Method stub generated by Lomboz
		String userID=request.getParameter("userID");
		String password=request.getParameter("password");
		if((userID.equals("guest")&&password.equals("guest"))){
			 RequestDispatcher dispatcher =
			      getServletConfig().getServletContext().getRequestDispatcher("/loginsucess");
			    dispatcher.forward(request, response);
		}
		else{
			RequestDispatcher dispatcher =
			      getServletConfig().getServletContext().getRequestDispatcher("/loginfail");
			    dispatcher.forward(request, response);
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -