Li Wu:
Learn to think more, honouring teachers save Thanksgiving. Leaf See Root 321, rivers with one.
Meekness Conscience Lord, willing to do without regrets to the most bitter. Reading exercise strong body and mind, Prudential advised and the line and cherish.
Javaee:7
javase:1.8
jstl:1.2.2
Server:tomcat 8.5
Explorer:firefox
Os:windows7 x64
Ide:myeclipse
Project directory Structure
Xml
<?xml version= "1.0" encoding= "UTF-8"? ><web-app xmlns:xsi= "http:// Www.w3.org/2001/XMLSchema-instance "xmlns=" Http://xmlns.jcp.org/xml/ns/javaee "xsi:schemalocation="/HTTP/ Xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd "id=" webapp_id "version=" 3.1 "> <servlet><servlet-name>MyHttpServlet</servlet-name><servlet-class> jizuiku.web.servlet.myhttpservlet</servlet-class><!--perform this class of--><init-param><param-name >minNum</param-name><param-value>10</param-value></init-param><init-param> <param-name>maxnum</param-name><param-value>100</param-value></init-param></ Servlet><servlet-mapping><servlet-name>myhttpservlet</servlet-name> <!--two name corresponding-- ><url-pattern>/MyHttpServletDemo</url-pattern><!--Access is this path--></servlet-mapping>< /web-app>
Code
Package Jizuiku.web.servlet;import javax.servlet.http.httpservlet;/** * Inherits HttpServlet, does not rewrite dogetdopost () * * @ Author to the bitter * @version V17.10.20 */public class Myhttpservlet extends HttpServlet {/** * */private static final long SE Rialversionuid = 1L;}
Use get to access the specified page effect
Index.jsp's Code
<%@ page language= "java" import= "java.util.*" pageencoding= "iso-8859-1"%><%string path = Request.getcontextpath (); String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";%> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >Use post to access the specified page effect
Learning resources: Itcast and Itheima Video library. If you have public resources, can share to me, with your resources to learn also can.
Blog post is to watch the video, into thinking written. It's good that the teacher speaks well. Blog bad, is to give the most bitter not serious.
Javaweb Base HttpServlet Browser 405 inherited and not rewritten dogetdopost () is called