Classroom dictation (4)

Load instantiation

initialization

Processing load request

destroy

 

Realization select Interface

l All Java Servlet interface class basis, by the process set to be a predetermined specific class implements Servlet

Inheritance jencricselect

Is a generic version of Servlet, is unrelated to an agreement with the Servlet

Inheritance httpselect

l is expanded in GenericServlet basis based Http Servlet protocol
 
 
Servlet deployment it is mapped to internal Servlet Servlet, plus <servlet-mapping> it is mapped to the URL the user visited the internal name of the Servlet
<servlet-mapping>与<servlet><servlet-name>
 
 
@Servlet("   ")
 
requsetset

.request object receives information

Background Gets the value of the front end:

request.getParameter ( "error"); quotation marks are the property name

response object response information

Redirect:

info = "user name or password is incorrect!";

/ * UTF-8 encoding statement format into a response formatted URL code * /

info =new String(info.getBytes("UTF-8"),"ISO-8859-1");

/ * The information in response to outgoing * /

/ * Redirect, close Servelt page, page and re-enter the client information passed through the URL passed in the past * /

response.sendRedirect("/newsDetail.jsp?error="+info);

Forward:

/ * Set the requested attributes (attribute name and attribute value) * /

request.setAttribute("info",info);

/ * * URL information forwarded back /

request.getRequestDispatcher("/login.jsp").forward(request,response);

 

 

${   }

To see whether it is null

${empty list}

 

Guess you like

Origin www.cnblogs.com/liyado/p/10987605.html