Servletrequest in which package




















It has the signature shown here: Cookie String name , String value. Here, the name and value of the cookie are supplied as arguments to the constructor. The methods of the Cookie class are summarized in Table The HttpServlet Class. The HttpServlet class extends GenericServlet. It is commonly used when developing servlets that receive and process HTTP requests.

The methods defined by the HttpServlet class are summarized in Table Method : Description. Object clone : Returns a copy of this object. String getComment : Returns the comment. String getDomain : Returns the domain. String getName : Returns the name. String getPath : Returns the path. Otherwise, returns false. String getValue : Returns the value.

If httpOnly is false, the HttpOnly attribute is removed. This is the number of seconds after which the cookie is deleted.

Table The Methods Defined by Cookie. Developed by Therithal info, Chennai. Toggle navigation BrainKart. Author : Herbert Schildt Posted On : Class : Description Cookie : Allows state information to be stored on a client machine. The Cookie Class The Cookie class encapsulates a cookie.

It has the signature shown here: Cookie String name , String value Here, the name and value of the cookie are supplied as arguments to the constructor.

Method : Description Object clone : Returns a copy of this object. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server. Returns: the preferred Locale for the client getLocales java.

If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale , the default locale for the server. Returns: an Enumeration of preferred Locale objects for the client isSecure boolean isSecure Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

Returns: a boolean indicating if the request was made using a secure channel getRequestDispatcher RequestDispatcher getRequestDispatcher java.

A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static. The pathname specified may be relative, although it cannot extend outside the current servlet context. This method returns null if the servlet container cannot return a RequestDispatcher. The difference between this method and ServletContext getRequestDispatcher is that this method can take a relative path.

Parameters: path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet. Returns: an integer specifying the port number Since: Servlet 2. Returns: a String containing the host name of the IP on which the request was received. Since: Servlet 2.

Returns: a String containing the IP address on which the request was received. Returns: the servlet context to which this ServletRequest was last dispatched Since: Servlet 3. IllegalStateException Puts this request into asynchronous mode, and initializes its AsyncContext with the original unwrapped ServletRequest and ServletResponse objects. Calling this method will cause committal of the associated response to be delayed until AsyncContext complete is called on the returned AsyncContext , or the asynchronous operation has timed out.

This method clears the list of AsyncListener instances if any that were registered with the AsyncContext returned by the previous call to one of the startAsync methods, after calling each AsyncListener at its onStartAsync method. Subsequent invocations of this method, or its overloaded variant, will return the same AsyncContext instance, reinitialized as appropriate.

Returns: the re initialized AsyncContext Throws: IllegalStateException - if this request is within the scope of a filter or servlet that does not support asynchronous operations that is, isAsyncSupported returns false , or if this method is called again without any asynchronous dispatch resulting from one of the AsyncContext dispatch methods , is called outside the scope of any such dispatch, or is called again within the scope of the same dispatch, or if the response has already been closed Since: Servlet 3.

IllegalStateException Puts this request into asynchronous mode, and initializes its AsyncContext with the given request and response objects. The ServletRequest and ServletResponse arguments must be the same instances, or instances of ServletRequestWrapper and ServletResponseWrapper that wrap them, that were passed to the service method of the Servlet or the doFilter method of the Filter, respectively, in whose scope this method is being called.

Calling AsyncContext hasOriginalRequestAndResponse on the returned AsyncContext will return false , unless the passed in ServletRequest and ServletResponse arguments are the original ones or do not carry any application-provided wrappers. A ServletRequestWrapper applied during the inbound invocation of a filter may be released by the outbound invocation of the filter only if the given servletRequest , which is used to initialize the AsyncContext and will be returned by a call to AsyncContext getRequest , does not contain said ServletRequestWrapper.

The same holds true for ServletResponseWrapper instances. Subsequent invocations of this method, or its zero-argument variant, will return the same AsyncContext instance, reinitialized as appropriate.

If a call to this method is followed by a call to its zero-argument variant, the specified and possibly wrapped request and response objects will remain locked in on the returned AsyncContext. Parameters: servletRequest - the ServletRequest used to initialize the AsyncContext servletResponse - the ServletResponse used to initialize the AsyncContext Returns: the re initialized AsyncContext Throws: IllegalStateException - if this request is within the scope of a filter or servlet that does not support asynchronous operations that is, isAsyncSupported returns false , or if this method is called again without any asynchronous dispatch resulting from one of the AsyncContext dispatch methods , is called outside the scope of any such dispatch, or is called again within the scope of the same dispatch, or if the response has already been closed Since: Servlet 3.

This method returns false if this request was put into asynchronous mode, but has since been dispatched using one of the AsyncContext dispatch methods or released from asynchronous mode via a call to AsyncContext complete. Returns: true if this request has been put into asynchronous mode, false otherwise Since: Servlet 3. Asynchronous operation is disabled for this request if this request is within the scope of a filter or servlet that has not been annotated or flagged in the deployment descriptor as being able to support asynchronous handling.

Returns: true if this request supports asynchronous operation, false otherwise Since: Servlet 3. Returns: the AsyncContext that was created or reinitialized by the most recent invocation of startAsync or startAsync ServletRequest,ServletResponse on this request Throws: IllegalStateException - if this request has not been put into asynchronous mode, i.

The dispatcher type of a request is used by the container to select the filters that need to be applied to the request: Only filters with matching dispatcher type and url patterns will be applied. Allowing a filter that has been configured for multiple dispatcher types to query a request for its dispatcher type allows the filter to process the request differently depending on its dispatcher type.

The initial dispatcher type of a request is defined as DispatcherType. Finally, the dispatcher type of a request dispatched to an error page by the container's error handling mechanism is given as DispatcherType. Returns: the dispatcher type of this request Since: Servlet 3. All Rights Reserved. Use is subject to license terms. Generated on February Scripting on this page tracks web page traffic, but does not change the content in any way.

Provides a convenient implementation of the HttpServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session.

This is the class representing event notifications for changes to sessions within a web application. The javax. Allows runtime discovery of the manner in which the HttpServlet for the current HttpServletRequest was invoked.

Causes an object to be notified when it is bound to or unbound from a session.



0コメント

  • 1000 / 1000