Creating Servlet Configuration
a new dynamic (Dynamic)
Note: version: you must choose 2.5 or will not automatically create web.xml
Benefits : direct create a Servlet under src, with a good will automatically web.xml
Drawback : only automatically create web.xml, it is not automatically deleted. But if deleted Servlet, web.xml is not automatically deleted, if the construction of the same name Servlet conflict.
Add shortcuts Servlet template
windows--preferences--java--Editor--Templates--New
Instructions knock ser + alt + /
package ${enclosing_package}; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class ${primary_type_name} extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().write("hello sensen..."); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
JSP登录功能
步骤:
1.WebContent下new一个login.jsp
2.建立三层包 dao、service、