Web hosting ecommerce - A.1 ActionServlet and RequestProcessor A new class called

A.1 ActionServlet and RequestProcessor A new class called RequestProcessor was added to the framework in Struts 1.1. This class takes over much of the work that the ActionServlet class performed in previous versions. With 1.1, you can still configure the class name of the ActionServlet that you want to use for an application in the web.xml file, but the RequestProcessor now carries out much of the real request-processing work. By default, applications use the org.apache.struts.action.RequestProcessorclass to handle all incoming requests. You are not required to do anything if the default behavior suits your requirements. You can, however, choose to override the default implementation with one of your own. You can switch implementations by configuring the controllerelement in the Struts configuration file. See Chapter 4 for more details on configuring the controller element. A.2 Modifications to the Struts Action Class The Struts base Action class has been modified with a new method called execute( ). This new method should be called instead of the perform( )method. The main difference between the two is that the execute( )method declares that it throws java.lang.Exception, whereas the earlier perform( ) method declared IOExceptionand ServletException. This change was necessary to facilitate the new declarative exception- handling feature that was added to Struts 1.1. The perform( )method has been deprecated and should not be used. A.3 Changes to web.xml and struts-config.xml There have been many changes to the two configuration files required by Struts applications. The web.xml file has had several initialization parameters removed; they are now supported by elements within the struts-config.xml file. The web.xml file also supports a few new parameters. The elements of both files are covered in Chapter 4 and will not be repeated here. You can check the Struts DTD to see exactly which elements are supported in a Struts configuration file. You will need to update your Struts configuration file to use the latest DTD, which is called strutsconfig_1_1.dtd. You will get many parsing errors if you forget to do this. A.4 New Features of Struts 1.1 The new features in Version 1.1 of the Struts framework are covered in detail throughout this book. Descriptions of the most important ones are provided here. A.4.1 Declarative Exception Handling Prior to 1.1, exception handling was completely left up to the application. There was no support for it in the core framework, and developers were left to their own devices to figure out how to handle exceptions within an application.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply