Jakarta Struts : Mastering Java web applications with courage


What are Java Servlets? Java Servlets have become the mainstay for extending and enhancing web applications using the Java platform.

They provide a component-based, platform-independent method for building web applications. Servlets don’t suffer from the same performance limitations that standard CGI applications incur. Servlets differ from the standard CGI threading model in that they create a single heavyweight process and allow each user request to utilize a much lighter-weight thread, which is maintained by the JVM, to fulfill the request.

Many user requests can be threaded through the same instance of a servlet. A servlet is mapped to one or more Uniform Resource Locators (URLs) and when the server receives a request to one of the servlet URLs, the service method in the servlet is invoked and responds.

Because each user request is associated with a separate thread, multiple threads or users, can invoke the service method at the same time. This multithreaded nature of servlets is one of the main reasons that they are much more scalable than standard CGI applications. Since servlets are written in Java, they are also not proprietary to a platform or OS.

Categories: , Tag: