Interface Single ThreadModel

 Interface  Single ThreadModel

package:  javax.servlet 

This interface ensures that serlets handle only one request at a time. This interface has no methods.If a servlet implements this interface, you are grarateed that no teo threads will execute concurrently in the servlet's service method. The servlet container can make this guaranted by synchronizing access to a single instance of the servlet, or by maintaining a pool of servlet instances and dispatching each new request to a free servlet.

This interface does not prevent synchronizartion problems that result from servlets accessing shared resources such as static class variables or classes outside the scope of the servlet.s

Interface : HttpServletRequest

package : javax.servlet.http   

Fields: 

   static java.lang.string  BASIC……AUTH

                    String identifier for Basic authentication.

   static java.lang.String  CLIENT__CERT__AUTH
                     string identifier for Basic authentication.

   static java.lang.string FORM__AUTH

                    string identifier for Basic authentication.

Methods: 

      java.lang.String getAuthType()

                    Returns the name of the authentication scheme used protect the servlet.

       java.lang.String  getcontextplath()

                    Returns the portion of the request URI that indicates the context of the request.

       cookie[]      getcookies()

                   Returns an array containing all of the cookie objects the client sent with this request.

     long getDateHeader(java.lang.string name)

                 Returns the value of the specified request header as a long value that represents a Date object.

           java.lang.string   getHeader (java.lang.String name)

                                         Returns anenumeration of all the header names this request contains 

           java.util.Enumeration   getHeaders(java.lang.string name)

                                                     Returns all the values of the specified  request header as an  string  Enumeration of String objects.

                          int            getIntHeader(java.lang.String name)

                                           Returns thename of the HTTP method with which this theURL the client sent when it made this request.

       java.lang.String        get IntHeader(java.lang.string name)

                                         Returns the value of the specified request header as an int.

     java.lang.String           getMethod()

                                          |Returns the name of the HTTP method with which this request wasmade, for example, GET,POST,orPUT.

  java.lang.String                getpathInfo()

                                         Returns any extra path information after the servlet name but before                                                           the query string, and translates it to a real path. 

   java.lang.String           getpathTranslated()

                                       Returns the query string that is contained in the request URL after the                                                                  path.

java.lang.String             getQueryString()

                                         Returns the session ID specified by the client.

java.lang.String            getRequestURI()

                                        Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

java.lang.StringBuffer    getRequestURL()

                                 Reconstructs the URL the client used to make the request.

java.lang.String         getServletpath()

                                  Returns the part of this reques's URL that calls the servlet.

HttpSession              getSession()

                                  Returns the current session associated with this request, or if                                              the request does not have a session, creates one.                                                                                                      

 HttpSession             getSession(boolean create)  

                           Returns the current HttpSession associated with this request or,if if there is no current session and create is true, returns a new session.                  

java.security.principal  getUserPrincipal()

            Returns a java.security.principal object containing the name of the current                            authenticated user.

boolean    is Request Session ID FromCookie()

         Checks whether the request session ID came in as a cookie.

boolean   is Requested Session ID Valid()

         Checks whether the requsted session ID is still valid.

boolean   isUserInRole()java.lang.string role)

         Returns a Boolean indicating whether the authenticated user is included in the specified logical "role".                  

 

No comments:

Post a Comment