Archive for the ‘ SCWCD ’ Category

The Form-based authentication is a type of authentication mechanism. It allows the developer to control the look and feel of the login authentication screens by customizing the login screen and error pages that an HTTP browser presents to the end user. The following actions occur when form-based authentication is declared:

  1. A client requests for accessing a protected resource.
  2. If the client is unauthenticated, the server redirects the client to a login page.
  3. The client submits the login form to the server.
  4. The server attempts to authenticate the user.

  • Share/Bookmark

What is the doTrace() method?

The doTrace() method allows a servlet to handle a TRACE request. It is called by the server via the service method. If the headers sent with the TRACE request, a TRACE is always returned to the client, so that they can be used in debugging. There’s no need to override this method. The following is the general format of the doTrace() method:

protected void doTrace(HttpServletRequest rq1, HttpServletResponse rsp1) throws ServletException, java.io.IOException

  • Share/Bookmark

What is the doOptions() method?

The doOptions() method is called by the server via the service method. It allows a servlet to handle a OPTIONS request. The OPTIONS request determines which HTTP methods the server supports and returns an appropriate header. The following is the general form of this method:

protected void doOptions(HttpServletRequest rq1, HttpServletResponse rsp1)
throws ServletException, java.io.IOException

Here, the parameter rq1 is the HttpServletRequest object that contains the request the client made of the servlet. The rsp1 is the HttpServletResponse object that contains the response the servlet returns to the client. If an input or output error occurs while the servlet is handling the OPTIONS request, it throws java.io.IOException. If the request for the OPTIONS cannot be handled, the ServletException exception is thrown.

  • Share/Bookmark

What is the getLastModified() method?

The getLastModified() method is used to return the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT. This method returns a negative number if the time is unknown. This method will be overriden by those Servlets that support HTTP GET requests and can quickly determine their last modification time. This method allows the browser and proxy caches work more effectively, reducing the load on server and network resources. The following is the general form of the method:

protected long getLastModified(HttpServletRequest rq1)

  • Share/Bookmark