Servlet 与 Struts2 性能
Servlets2.5和Struts2哪个性能更好。
Which on would be better in performance among Servlets2.5 and Struts2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
Servlets2.5和Struts2哪个性能更好。
Which on would be better in performance among Servlets2.5 and Struts2.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Struts2 在底层使用 Servlet。
理论上,Servlet 会比 Struts2 更快,但实际上您可能会注意到几乎为零的差异,因为应用程序中的瓶颈最不可能出现在 Web 应用程序框架中。
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 本质上意味着有一个默认的请求处理程序,它
为您进行一些预处理,然后致电该人
控制器...
控制器然后调用模型层来设置模型,然后
以声明方式(视图可通过
struts-config)将请求与值对象一起转发
将模型表示为渲染视图......
这非常简单 - 但是如果您需要充分利用
struts - 比如表单、验证、错误处理和资源
捆绑包等......至少,您应该能够重用该模型
整个层,而无需额外编写一行
代码 - IFF - 您一开始就正确设计了它...
有关您的应用程序的更多详细信息 - 您会找到更多帮助...
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 比 Servlet 更好。由于Struts2.0的filter有一个前端控制器,而struts1.2在底层使用Servlet。
Struts2 将拦截器作为一个具有内置验证的类。 Struts2也有自己的库来创建GUI。 Struts2还支持OGNL语言,这对于防止JSP文件中出现java代码很有用。最终,它的 MVC 架构。
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.