Which on would be better in performance among Servlets2.5 and Struts2.
An important conceptual difference with Servlets (and with Struts actions) is that Struts2 actions are not reused for different requests, and hence are thread safe: say, it can happen that three http requests (simultaneous or not) are served by one servlet instance; but inthat case we will still have three different ...
Struts 1 requires Action classes to extend an abstract base class. A common problem in Struts 1 is programming to abstract classes instead of interfaces. An Struts 2 Action may implement an Action interface, along with other interfaces to enable optional and custom services.
A Servlet is a technology and Struts is a framework which relies on or makes use of Servlets.
Struts 2 development is still active and, as of writing this article, the newest version is 2.5. 25. If you would like to start with Struts 2, remember that minimum requirements are Servlet API 2.4, JSP 2.0 and Java 7.
Struts2 uses Servlets underneath.
Theoretically Servlets will be faster than Struts2, however practically you may notice almost zero difference since the bottleneck in your app is least likely to be in your web-app framework.
Struts essentially means there is a default request handler, which does some pre-processing for you and then calls the individual controllers....
controllers then call the layer of models to setup the model and then in a declarative fashion (views are configurable via the struts-config) forward the request along with the value object representing the model to the views for rendering.....
this is pretty straight forward - however if you need to make full use of struts - like the forms,validation,error handling and resource bundles etc.... at the minimum, you should be able to reuse the model layer in its entirety without having to write one additional line of code - IFF - you had designed it correctly in the first place...
with more details about your application - you'll find more help...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With