Struts 1或Struts 2.对于Web应用程序开发,建议使用哪一个? [英] Struts 1 or Struts 2 . Which one is advisable for web application development?

查看:96
本文介绍了Struts 1或Struts 2.对于Web应用程序开发,建议使用哪一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我为新的Web应用程序开发任务选择Struts 1或Struts 2感到有些困惑.从架构的角度来看,有人可以建议我使用哪个框架进行开发吗?在开发应用程序之前,应注意选择struts版本的哪些要点? 任何帮助将不胜感激.

I am little bit confused to choose Struts 1 or Struts 2 for my new web application development assignment. Could any one suggest me which framework should I use for development from architecture point of view? What are the points I should take care of to choose the struts version before I go for development of the application? Any help will be appreciated.

推荐答案

我更喜欢struts 2,因为

Hi I prefer struts 2 because,

Struts 1.x

Struts 1.x

  1. 在struts 1.x中,前端控制器是 ActionServlet
  2. 在struts 1.x中,我们有 RequestProcessor
  3. 在struts 1.x中,我们有多个标记库,例如html,逻辑,bean .. etc
  4. 在struts 1.x中,配置优良名称可以是[任何名称] .xml,我们曾经将其放置在web-inf文件夹中
  5. 在struts 1.x中,我们分别具有 form bean Action类
  6. 在struts 1.x中,Action类是单个吨类,因此Action类对象不是线程安全的,作为程序员,我们需要通过应用同步使其成为线程安全的 li>
  7. 在struts 1.x中,我们仅只有jsp 作为视图技术
  1. In struts 1.x front controller is ActionServlet
  2. In struts 1.x we have RequestProcessor class
  3. In struts 1.x we have multiple tag libraries like html, logic, bean..etc
  4. In struts 1.x the configuration fine name can be [any name].xml and we used to place in web-inf folder
  5. In struts 1.x we have form beans and Action classes separately
  6. In struts 1.x an Action class is a single ton class, so Action class object is not a thread safe, as a programmer we need to make it as thread safe by applying synchronization
  7. In struts 1.x we have only jsp as a view technology

Struts 2.X

Struts 2.X

  1. 在2.x中,前端控制器是 FilterDispatcher
  2. 在2.x版本中,我们有拦截器而不是RequestProcessor
  3. 在2.x中,我们没有多个库,而是具有包含所有标签的单个库
  4. 在2.x版本中,配置文件必须仅是struts.xml,并且必须位于classes文件夹中
  5. 在2.x表单bean中,动作类仅作为动作类组合提供,当然,如果需要,我们可以单独使用
  6. 在2.x版本中,将为每个请求创建一个Action类对象,因此默认情况下它是线程安全的,因此我们无需在此处处理安全性问题
  7. 在2.x版本中,我们支持多种视图技术,例如速度,Freemarker,碧玉报告,jsp .
  1. In 2.x front controller is FilterDispatcher
  2. In 2.x we have Interceptors instead RequestProcessor
  3. In 2.x we do not have multiple libraries, instead we have single library which includes all tags
  4. In 2.x the configuration file must be struts.xml only and this must be in classes folder
  5. In 2.x form bean, Action classes are combinedly given as Action class only, of course we can take separately if we want
  6. In 2.x an Action class object will be created for each request, so it is by default thread safe, so we no need to take care about safety issues here
  7. In 2.x we have support of multiple view technologies like velocity, Freemarker, jasper reports, jsp.

这篇关于Struts 1或Struts 2.对于Web应用程序开发,建议使用哪一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆