欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOC文档下载
    分享到微信 分享到微博 分享到QQ空间

    计算机专业毕业设计外文翻译--Spring的web MVC 构架模式

    • 资源ID:129921       资源大小:42.50KB        全文页数:6页
    • 资源格式: DOC        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

    计算机专业毕业设计外文翻译--Spring的web MVC 构架模式

    1、Web MVC with the Spring Framework Juergen Hoeller 1. Introduction: Spring the Application Framework When first confronted with the Spring Framework, one might be tempted to think: Oh no, not yet another web framework. This article will outline why Spring isnt particularly a web framework but a gener

    2、ic lightweight application framework with dedicated web support, and show the architectural differences to Struts and WebWork In contrast to Struts or WebWork, Spring is an application framework for all layers: It offers a bean configuration foundation, AOP support, a JDBC abstraction framework, abs

    3、tract transaction support, etc. It is a very non-intrusive effort: Your application classes do not need to depend on any Spring classes if not necessary, and you can reuse every part on its own if you like to. From its very design, the framework encourages clean separation of tiers, most importantly

    4、 web tier and business logic: e.g. the validation framework does not depend on web controllers. Major goals are reusability and testability: Unnecessary container or framework dependencies can be considered avoidable evils. Of course, Springs own web support is nicely integrated with the frameworks

    5、general patterns. Nevertheless, replacing the web solution with Struts, WebWork, or the like is easy. Both with Springs web support or a different one, Spring allows for building a true dedicated middle tier in the web container, with the option to reuse exactly the same business logic in test envir

    6、onments or standalone applications. And within J2EE, your business logic will not unnecessarily depend on container services like JTA or EJB - allowing complex, well-architected web applications to run in a simple container like Tomcat or Resin. Note that Spring doesnt generally aim to compete with

    7、existing solutions. It rather fosters seamless integration with standards like Servlet, JSP, JTA, JNDI, JDBC, and JDO, and well-suited tools like Hibernate, Velocity, Log4J, and Cauchos Hessian/Burlap. The framework is designed to grow with the needs of your applications, in terms of technology choi

    8、ce: For example, you will probably use JTA via Springs JtaTransactionManager if you need distributed transactions - but only then, as there are perfect replacements for single databases, like DataSourceTransactionManager or HibernateTransactionManager. 2. Web MVC: The Design of Springs Web Framework

    9、 Springs web framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, and locale and theme resolution. The default handler is a very simple Controller interface, just offering a ModelAndView handleRequest(request,resp

    10、onse) method. This can already be used for application controllers, but you will prefer the included implementation hierarchy, consisting of AbstractController, AbstractCommandController, MultiActionController, SimpleFormController, AbstractWizardFormController. Application controllers will typicall

    11、y be subclasses of those. Note that you can choose an appropriate base class: If you dont have a form, you dont need a FormController. This is a major difference to Struts. You can take any object as command or form object: Theres no need to implement an interface or derive from a base class. Spring

    12、s data binding is highly flexible, e.g. it treats type mismatches as validation errors that can be evaluated by the application, not as system errors. So you dont need to duplicate your business objects properties as Strings in your form objects, just to be able to handle invalid submissions, or to

    13、convert the Strings properly. Instead, its often preferable to bind directly to your business objects. This is another major difference to Struts which is built around required base classes like Action and ActionForm - for every type of action. Compared to WebWork, Spring has more differentiated obj

    14、ect roles: It supports the notion of a Controller, an optional command or form object, and a model that gets passed to the view. The model will normally include the command or form object but also arbitrary reference data. Instead, a WebWork Action combines all those roles into one single object. We

    15、bWork does allow you to use existing business objects as part of your form, but just by making them bean properties of the respective Action class. Finally, the same Action instance that handles the request gets used for evaluation and form population in the view. Thus, reference data needs to be mo

    16、delled as bean properties of the Action too. These are arguably too many roles in one object. Regarding views: Springs view resolution is extremely flexible. A Controller implementation can even write a view directly to the response, returning null as ModelAndView. In the normal case, a ModelAndView

    17、 instance consists of a view name and a model Map, containing bean names and corresponding objects (like a command or form, reference data, etc). View name resolution is highly configurable, either via bean names, via a properties file, or via your own ViewResolver implementation. The abstract model

    18、 Map allows for complete abstraction of the view technology, without any hassle: Be it JSP, Velocity, or anything else - every renderer can be integrated directly. The model Map simply gets transformed into an appropriate format, like JSP request attributes or a Velocity template model. 3. Integrati

    19、on: Using a Different Web Framework with Spring Many teams will try to leverage their investments in terms of know-how and tools, both for existing projects and for new ones. Concretely, there are not only a large number of books and tools for Struts but also a lot of developers that have experience

    20、 with it. Thus, if you can live with Struts architectural flaws, it can still be a viable choice for the web layer. The same applies to WebWork and other web frameworks. If you dont want to use Springs web MVC but intend to leverage other solutions that Spring offers, you can integrate the web frame

    21、work of your choice with Spring easily. Simply start up a Spring root application context via its ContextLoaderListener, and access it via its ServletContext attribute (or Springs respective helper method) from within a Struts or WebWork action. Note that there arent any plugins involved, therefore

    22、no dedicated integration: From the view of the web layer, youll simply use Spring as a library, with the root application context instance as entry point. All your registered beans and all of Springs services can be at your fingertips even without Springs web MVC. Spring doesnt compete with Struts o

    23、r WebWork in this usage, it just addresses the many areas that the pure web frameworks dont, from bean configuration to data access and transaction handling. So you are able to enrich your application with a Spring middle tier and/or data access tier, even if you just want to use e.g. the transactio

    24、n abstraction with JDBC or Hibernate. 4. Feature Check List If just focussing on the web support, some of Springs unique features are: .Clear separation of roles: controller vs validator vs command object vs form object vs model object, DispatcherServlet vs handler mapping vs view resolver, etc. .Po

    25、werful and straightforward configuration of both framework and application classes as JavaBeans, including easy in-between referencing via an application context, e.g. from web controllers to business objects and validators. .Adaptability, non-intrusiveness: Use whatever Controller subclass you need

    26、 (plain, command, form, wizard, multi action, or a custom one) for a given scenario instead of deriving from Action/ActionForm for everything. .Reusable business code, no need for duplication: You can use existing business objects as command or form objects instead of mirroring them in special Actio

    27、nForm subclasses. .Customizable binding and validation: type mismatches as application-level validation errors that keep the offending value, localized date and number binding, etc instead of String-only form objects with manual parsing and conversion to business objects. Customizable handler mappin

    28、g, customizable view resolution: flexible model transfer via name/value Map, handler mapping and view resolution strategies from simple to sophisticated instead of one single way. Customizable locale and theme resolution, support for JSPs with and without Spring tag library, support for JSTL, support for Velocity without the need for extra bridges, etc. Simple but powerful tag library that avoids HTML generation at any cost, allowing for maximum flexibility in terms of markup code.


    注意事项

    本文(计算机专业毕业设计外文翻译--Spring的web MVC 构架模式)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583