6.servlet工作流程,如何解决配置文件过于繁琐的问题
ervlet工作流程,如何解决配置文件过于繁琐的问题
表单文件:login.jspServlet文件:LoginServlet.java配置文件:web.xml下面对是这几个文件的代码:login.jsp<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'login.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head <body> <form action="/ServletStudy/LoginServlet"> userName: <input name="userName" type="text"/><br/> password: <input name="password" type="password"/><br/> <input type="submit"value="submit"/> <input type="reset"value="reset"/> </form> </body></html>LoginServlet.javapackage com;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;@SuppressWarnings("serial")public class LoginServlet extends HttpServlet{