开发者

Servlet Vs Struts2 Performance

开发者 https://www.devze.com 2023-02-16 09:37 出处:网络
Which on would be better in performance among Servlets2.5 and Struts2开发者_开发技巧.Struts2 uses Servlets underneath.

Which on would be better in performance among Servlets2.5 and Struts2开发者_开发技巧.


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...


Struts2 is better than Servlets. As Struts2.0 has filter has a front end controller while struts1.2 uses Servlets underneath.

Struts2 has interceptor as a class which has inbuild validation. Struts2 has also its own library to create GUI. Struts2 also support OGNL language which is useful to prevent java code in JSP file. and Ultimately, its MVC architecture.

0

精彩评论

暂无评论...
验证码 换一张
取 消