2012年5月4日星期五

Grossiste chaussures

J2EEprovides us with 13 standard.The servlet web development is the core of the standard. Let us into the servlet learning .A :introduction to servlet Servlet is running on the Web server Java procedures ,used in response to customer requests .
Also can say ,Servlet is a Java component ,deployed in the Web server ,the request / response communication mode to work effectively .Our common J 2EEon the servlet classes and interfaces are many, our common is the servlet interface .
This is all servlet to realize an interface. And GenericServlet general servlet is independent of the protocol of servlet. It implements the servlet interface .We used is HttpServlet which is used in HTTP agreement on the servlet.
Two :the following general aspects of servlet were summarized 1: interfacewe can use one of the following two ways to create Servlet: the Servlet interface to achieve the expansion of class GenericServlet or class HttpServlet Servlet creation ,but also describes the Servlet details ,as well as in the runtime environment, Servlet and Web application other associated Web component of additional information .
Specification XML embedded in the document, these information is called the deployment descriptor for the Web container ,in the deployment of components when used .To create and deploy Servlet, Servlet becomes the Web server container in the examples .
We can create two types of servlet is a single-threaded servlet. SingleThreadModel .Web container will all customer requests to an instance. The other is a multi-threaded servlet. Multithread servlet there are so many places that need attention.
Is very easy to create the data inconsistency. 2: servletlife cycle the init ( ) method to make Servlet into the ready state .Later, Servlet can receive a service request, services when requested to execute ( ) method service .
When the container is the decision to destroy the Servlet, call the destroy ( ) method .Servlet .The init ( ) method is called by the container ,one time only, make Servlet into a ready state .
This process is called Servlet initialization .If the beginning is abnormal ,Servlet will not respond to any user request .During initialization, the init ( ) method using ServletConfig object .
ServletConfig contains Servlet need initialization parameter name value pair .Usually ,directory ,file path and other information will be written to the object .The servlet service .To properly initialize the Servlet ,Servlet can receive the client service request .
Servlet container may through the Servlet service ( ) method for sending multiple concurrent requests .The form submission after first is the implementation of the service ( ) method . Service method calls the do get ( ) or doPost method .
This according to client decision .Servlet destroyed. When the container that is no longer needed a Servlet ,can be call Servlet destroy ( ) method ,the release of Servlet occupants of all container resources .
However ,the container does not call Servlet destroy ( ) method .Call Servlet destroy ( ) method ,the container needs to ensure that the following two points :the obstruction of more new request .
Finish all the pending request 3: Servletcontext Web server can support several Web applications .Each Web application can support one or more Servlet .The same Web applications to multiple Servlet need to share the Web application environment .
Therefore ,the Servlet specification provides a ServletContext interface .For ServletContext, the most important contextual information includes :the initialization parameters context attributes resource initialization parameters .
Initialization parameters are used to initialize the Web application ,rather than the previous Servlet area discuss the single Servlet .These parameters by a deployment descriptor key value to provide .
The ServletContextAPI allows getInitParameter ( ) and getInitParameterNames ( ) methods to access these initialization parameters .Context attributes .Context attributes are a group of application properties ,by Web Servlet application sharing .
Can be set and the obtained parameters Grossiste chaussures,also available through programming method ,from a Web application remove context attribute .ServletContextAPI allows through a variety of methods to access the context attributes ,such as setAttribute ( ) ,getAttribute ( ) ,removeAttribute ( ) and getAttributeNames ( ) .
Resources. Static content file hierarchy ,is part of a Web application ,called Web application resources ,including HTML ,GIF and JPEG files .ServletContextAPI allows access to these resources through a variety of methods ,such as getResource ( ) and getResourceAsStream ( ) .
The 4 request to the Servletservice method has access to the requested object ServletRequest or HttpServletRequest .Request object contains the client request and some other related information .
The object will be passed to the service ( ) method of the two parameters of the first parameter .Request parameter using the key value to the format .In certain circumstances ,some of the keys may have multiple values .
The HttpServletRequest object to several important aspects are as follows: the attribute ,head Cookie 5in response to a Servletservice method has access to the response object .The response object will be ServletResponse or HttpServletResponse .
This object contains the response to the client information and all other details ,is the service ( ) method of the two parameters of second parameters .The client response is packaged in the HttpServletResponse object .
The HttpServletResponse object is an important part of :* head .The buffer * response type and format of 6filter(filtering ) is the Servlet2.3 version of the new features .Filter is a special Servlet filter ( Filter ) is a lightweight Web components ,timely conversion HttpServletRequest and HttpServletResponse object header and content .
Filter and Servlet are part of a Web application ,using life cycle management .As the name suggests ,the Filter Servlet request / response operations to provide filtering service .As shown in Figure 6-13 ,the filter can be filtering passed to the Servlet request ,can also filtering will be sent from the Servlet to the client .
They not only static content ,but also handle dynamic content .Web applications available number of filter components as follows :the authentication Filter .Filter encryption ,converting Filter 7 sessiona portion of this specification is intended to be bound to a particular client session ,in order to be from a client to a Web application in a series of request / response operation is considered the ultimate business component .
The need to do some work ,from design, HTTP is a stateless protocol .Servlet supports the following session tracking mechanism :Cookie .HTTP session URL rewrite 8 .Safety most enterprise applications on the Internet deployment operation ,so it is necessary to create a safe environment ,so that users in the enterprise application security execution of transactions .
Any enterprise applications will require some of the following basic safety function :the identity authentication access control data integrity ,confidentiality is by using a combination of the following two ways to ensure the safety of Web application program :Declaration of security ,programmatic Security 9deployment descriptorslike Web application deployment descriptor calendar .
This is a XML file describing the content .Servlet version 2.3 requires the use ofthe required deployment descriptor ,to record the Web application procedure important aspects :the Servlet statement Servlet mapping ServletContext initialization parameters session statement .
Source by the beats by dre relate article:

没有评论:

发表评论