servlet学习

1 重写int时 第一句要调用super.init


2 doGet  doPost doPut doDelete 如果一样 可以统一写在service里


3 servlet创建的两种时机:初次请求时   load-on-servlet


4

ServletConfig config = getServletConfig();
String name = config.getParameter("");

 

5

RequestDispatcher rd = request.getRequestDispatcher("\index.jsp");
rd.dispatch(request,response);

 

6

String path = request.getServletPath();
String base = request.getSchema + "://" + request.getServerName()+":" + request.getServerPort() + path + "/"
 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(jsp,servlet)