In the example, we have declared a class by name SimpleServlet and this class is not made to extend or implement any of the Servlet/HttpServlet types. InitParams = "param1", value = "param2", value = "value2")} In this section, we will see the usage of and using an example. The following annotations are applicable starting from Servlet 3.0 specification, If the value for metadata-complete is set to false, then it means that the information in the deployment descriptor is not complete and web components decorated with annotations, if any, should be scanned and processed by the Web Container. So, if the value for the metadata-complete element is set to a value of true, then it means that the meta information found in the deployment descriptor is complete and eventually the annotations defined on the web components will be ignored by the Servlet Container. The metadata-complete element indicates whether the meta-data information available in the deployment descriptor is complete. The name of the element is metadata-complete and it is a child element of web-app element. The Servlet 3.0 specification also provides an option for instructing the Web Container, whether the container should process the annotations defined on the web components. In fact information specified in the deployment descriptor takes precedence over the information specified through Annotations. It doesn’t mean the deployment descriptor is now gone, deployment descriptor in the form of web.xml is still there. Starting from Servlet 3.0, it is also possible to specify the meta information about a component in the definition of a component itself, through Annotations. The information about web components such as Servlets, Servlet Filters are mentioned in the deployment descriptor, which is web.xml. The configuration information about a component in a typical web application is expressed in an external meta file. For attitional information please read the reference section of this article. JSR 315 talks about the Servlet 3.0 features. The article is finally concluded by detailing about the asynchronous execution of processing and the usage for the same. This article focuses on the new set of annotations introduced that can be used by developers rather than put the data in the configuration file, followed by the enhanced Pluggability and the extension support for adding third-party frameworks. Note that the Servlet 3.0 specification constantly keeps changing frequently with the reviews coming in and the features and the API’s mentioned in this article is based on the specification that is available in JCP for public review as of December 2008. This article covers most of the important features available as part of Servlet 3.0 specification.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |