struts2教程

Welcome to Struts 2 Tutorial index post. Struts 2 is one of the mostly used Java Web Application Framework and recently I have wrote a lot about it. Struts 2 is built on top of Struts1 and WebWork framework that makes it highly flexible, extendable and easy to maintain.

欢迎使用Struts 2教程索引文章。 Struts 2是最常用的Java Web应用程序框架之一,最近我写了很多关于它的文章。 Struts 2建立在Struts1和WebWork框架的基础上,使其高度灵活,可扩展且易于维护。

Struts 2教程 (Struts 2 Tutorial)

If you want to learn Struts 2 and it’s important features then please read all the below articles in order. All these articles provide framework features in great details and comes with downloadable web application projects.

如果您想学习Struts 2及其重要功能,请按顺序阅读以下所有文章。 所有这些文章都提供了非常详细的框架功能,并附带了可下载的Web应用程序项目。

Struts 2初学者教程 (Struts 2 Tutorial for Beginners)

  1. Struts 2 Example for BeginnersThis is the first article in the series, here you will learn about basics of Struts 2 with brief details about it’s architecture, framework core concepts such as Interceptors, OGNL, Action, Results, wiring the application components etc. The article also provides basic example of Struts 2 web application project with XML based configuration.Struts 2入门示例这是该系列的第一篇文章,您将在这里了解Struts 2的基础知识,并简要了解Struts 2的体系结构,框架核心概念(例如,拦截器,OGNL,Action,结果,连接应用程序组件等)。本文还提供了具有基于XML配置的Struts 2 Web应用程序项目的基本示例。
  2. Struts 2 Annotations Example ProjectJava Annotations are becoming popular in most of the Java EE frameworks and Struts 2 provides a lot of annotations that we can use to create Struts 2 web application with zero configuration i.e. without having struts configuration file. Check out the article to learn about the commonly used annotations in Struts 2 framework. The article also provides an example project built with annotations and without having any struts configuration file that you can download and play around.Struts 2注释示例项目 Java注释在大多数Java EE框架中变得越来越流行,并且Struts 2提供了许多注释,我们可以使用它们创建零配置(即没有struts配置文件)的Struts 2 Web应用程序。 查看文章以了解Struts 2框架中的常用注释。 本文还提供了一个使用批注构建的示例项目,而没有可供下载和播放的任何struts配置文件。
  3. Struts 2 Result Path ConfigurationWe can configure Struts 2 application to look for result pages at specific location, the article provide brief details about this using XML based configuration as well as annotation based.Struts 2结果路径配置我们可以配置Struts 2应用程序以在特定位置查找结果页面,本文使用基于XML的配置以及基于注释的方法提供有关此结果的简短详细信息。
  4. Struts 2 No result defined for action and result inputA common error faced while working with Struts 2 application because of validation failure and there is no result configured for “input” in struts configuration file.Struts 2没有为操作和结果输入定义结果由于验证失败,在Struts 2应用程序中使用时会遇到一个常见错误,并且在struts配置文件中没有为“输入”配置任何结果。

Struts 2动作 (Struts 2 Action)

  1. Struts 2 Action ClassesAction classes are at the front of our application and we invest a lot of time in designing and developing action classes. The article explains about four different ways to create action classes in Struts 2 framework. Learn about these ways and which is the good option to chose in your application action classes.Struts 2动作类动作类在我们的应用程序中处于领先地位,我们在设计和开发动作类上投入了大量时间。 本文介绍了在Struts 2框架中创建动作类的四种不同方法。 了解这些方法,这是在应用程序操作类中选择的不错的选择。
  2. Struts 2 Action Object-backed and ModelDriven ExampleMost of the times we don’t want form bean properties to be part of action classes and we want to have them in a java bean that we can use in action classes. There are two approaches to achieve this – Object-backed and ModelDriven. The article explains about both of these approaches and which is the best approach to use.Struts 2动作对象支持和ModelDriven示例在大多数情况下,我们不希望表单bean属性成为动作类的一部分,我们希望将它们包含在可用于动作类的java bean中。 有两种方法可以实现这一点-对象支持和模型驱动。 本文介绍了这两种方法,以及哪种方法是最佳使用方法。
  3. Struts2 Action Messages and Action Errors ExampleWe can override ActionSupport validate() method to have form field validation at server side and return the input page with action error messages to show in result pages. Similarly we can add action messages to show in result pages.Struts2操作消息和操作错误示例我们可以重写ActionSupport validate()方法以在服务器端进行表单字段验证,并返回输入页面以及操作错误消息以显示在结果页面中。 同样,我们可以添加操作消息以显示在结果页面中。

Struts 2拦截器 (Struts 2 Interceptors)

  1. Struts 2 Interceptor Tutorial with Custom Interceptor ExampleStruts2 interceptors are the backbone of the framework and defined in struts-default package. Struts2 interceptors are great example of Chain of Responsibility pattern implementation. This article explains about the working of interceptors and how easily we can create our own interceptor and configure it for action. The article shows how we can achieve authentication across the application with the use of custom interceptors and make our code loosely coupled and achieve flexibility with code reuse.带自定义拦截器示例的Struts 2拦截器教程 Struts2拦截器是框架的基础,并在struts-default程序包中定义。 Struts2拦截器是责任链模式实现的一个很好的例子。 本文介绍了拦截器的工作原理,以及我们如何轻松地创建自己的拦截器并对其进行配置以进行操作。 本文说明了如何使用自定义拦截器在整个应用程序中实现身份验证,并使我们的代码松耦合,并通过代码重用实现灵活性。
  2. Struts2 token interceptorWe can use Struts2 token and tokenSession interceptors to handle multiple form submission problem at server side in the web application. This article explains about these interceptors in detail with a working example.Struts2令牌拦截器我们可以使用Struts2令牌和tokenSession拦截器在Web应用程序的服务器端处理多种表单提交问题。 本文通过一个有效的示例详细说明了这些拦截器。
  3. Struts2 execAndWait interceptorWe can use Struts2 execAndWait interceptor to return an intermediate response page to client incase of long running action classes. Once the action class execution is finished, the final response is returned to the client. This article explains about execAndWait interceptor and how can we use this for long running action classes.Struts2 execAndWait拦截器如果长时间运行的动作类,我们可以使用Struts2 execAndWait拦截器将中间响应页面返回给客户端。 动作类执行完成后,最终响应将返回给客户端。 本文介绍了execAndWait拦截器,以及如何将其用于长时间运行的动作类。

Struts 2的标签 (Struts 2 Tags)

  1. Struts 2 OGNL TutorialStruts2 uses OGNL expression language for data transfer from request to action classes bean properties and type conversion from String to objects and vice versa in result pages. The article provide details about the usage of OGNL expressions and how we can create our own type converter classes.Struts 2 OGNL教程 Struts2使用OGNL表达式语言从请求到动作类bean属性进行数据传输,并在结果页面中从String到对象进行类型转换,反之亦然。 本文提供有关OGNL表达式的用法以及如何创建自己的类型转换器类的详细信息。
  2. Struts2 Data TagsStruts2 comes with rich tags that can be categorized into data, control and UI tags. This article provide details about majorly used Struts2 data tags with example project.Struts2数据标签 Struts2带有丰富的标签,可以将其分类为数据,控件和UI标签。 本文提供有关示例项目中常用的Struts2数据标签的详细信息。
  3. Struts2 Control TagsStruts2 control tags are used for manipulation and navigation of data from a collection. This article provide details about the Struts2 control tags and how we can use them for conditional flow and iterate over an array or collection. We also learn about some other control tags used to sort list, merge lists, append lists and take subset of list with example project.Struts2控件标签 Struts2控件标签用于操作和导航集合中的数据。 本文提供有关Struts2控件标签的详细信息,以及如何将它们用于条件流以及如何在数组或集合上进行迭代。 我们还将了解其他一些控制标签,这些标签用于对示例项目进行排序,合并列表,追加列表以及获取列表子集。
  4. Struts2 UI TagsStruts2 UI tags are used to generate HTML form elements in result pages. UI tags are also responsible for binding form properties to action class properties. This article provide details about mostly used UI tags with example project.Struts2 UI标记 Struts2 UI标记用于在结果页面中生成HTML表单元素。 UI标记还负责将表单属性绑定到动作类属性。 本文提供了有关示例项目中最常用的UI标记的详细信息。

Struts 2本地化 (Struts 2 Localization)

Struts2 Resource Bundles and Localization

Struts2资源包和本地化

Struts2 provides strong support for internationalization through I18nInterceptor and resource bundles. This article explains about i18n support in Struts2 framework with different locations of resource bundles with example project.

Struts2通过I18nInterceptor和资源包为国际化提供了强大的支持。 本文介绍了示例项目中Struts2框架中i18n支持的不同资源包位置。

Struts 2教程–其他 (Struts 2 Tutorial – Miscellaneous)

  1. Struts2 Single and Multiple File Upload ExampleFile uploading is one of the common tasks in the web application. That’s why Struts2 provides FileUploadInterceptor interceptor that we can use to upload Single as well as multiple files on the server without using any third party tools. The article explains about this interceptor in detail with example project to upload files on server.Struts2单文件和多文件上传示例文件上传是Web应用程序中的常见任务之一。 这就是Struts2提供FileUploadInterceptor拦截器的原因,我们可以使用该拦截器在服务器上上传单个以及多个文件,而无需使用任何第三方工具。 本文详细介绍了有关此拦截器的示例项目,该示例项目可将文件上传到服务器上。
  2. How to get Servlet Session, Request, Response, Context Attributes in Struts 2 ActionSometimes we want to have access to Servlet API components such as Session, Request and Response in action classes. Struts2 provides a bunch of *Aware interfaces that we can implement in action classes to inject Servlet API components in action classes.如何在Struts 2 Action中获取Servlet的Session,Request,Response和Context属性有时我们希望访问Servlet API组件,例如Action类中的Session,Request和Response。 Struts2提供了一堆* Aware接口,我们可以在操作类中实现这些接口,以便将Servlet API组件注入到操作类中。
  3. Struts2 and log4j integrationThis article explains how we can integrate log4j with Struts2 framework in our web application for logging purposes.Struts2和log4j集成本文介绍了如何将Log4j与Struts2框架集成到Web应用程序中以进行日志记录。
  4. Struts2 Exception HandlingStruts2 provide convenient ways to configure error pages for exceptions thrown by our application at global package level as well as action level. Again this is done by Struts2 exception interceptor that is part of defaultStack. Check out this post for example project with usage details.Struts2异常处理 Struts2提供了便捷的方法来配置错误页面,以在全局包级别和操作级别为应用程序抛出的异常进行配置。 同样,这是由DefaultStack的一部分Struts2异常拦截器完成的。 请查看这篇文章,以了解有关使用情况的示例项目。
  5. Struts2 Hibernate Integration ExampleMostly we use an ORM tool in enterprise applications and Hibernate is one of the best choices available in the market. This tutorial provide details about how to integrate Hibernate with Struts2 framework in a web application with downloadable example project.Struts2 Hibernate集成示例通常,我们在企业应用程序中使用ORM工具,而Hibernate是市场上最好的选择之一。 本教程提供了有关如何通过可下载的示例项目在Web应用程序中集成Hibernate与Struts2框架的详细信息。

Struts 2面试题 (Struts 2 Interview Questions)

This article lists most important Struts 2 interview questions with detailed answers to clear you through interview.

本文列出了最重要的Struts 2面试问题,并提供了详细的答案,可帮助您通过面试使您清晰。

There are more articles to come in Struts 2 tutorial series, do bookmark this post for future reference.

Struts 2教程系列中还会有更多文章,请为这篇文章添加书签以供将来参考。

翻译自: https://www.journaldev.com/2310/struts-2-tutorial

struts2教程

struts2教程_Struts 2教程– Struts2教程相关推荐

  1. struts2登录注册示例_Struts 2动作示例教程

    struts2登录注册示例 If you are working on Struts 2, you will spent a lot of time developing Struts 2 Actio ...

  2. struts2异常处理流程_Struts2异常处理示例教程

    struts2异常处理流程 Exceptions are common in any application. We try to catch it and process it but someti ...

  3. MyEclipse搭建SSH(Struts2+Spring2+Hibernate3)框架项目教程

    对Struts.spring.hibernate大体上了解一遍后,就是针对这个几个框架的整合了. 怎样整合,请看以下: 第一:Struts2的jar和xml配置文件: jar包: commons-fi ...

  4. python基础教程博客_python基础教程(一)

    之所以选择py交易有以下几点:1.python是胶水语言(跨平台),2.python无所不能(除了底层),3.python编写方便(notepad++等文本编辑器就能搞事情),4.渗透方面很多脚本都是 ...

  5. python基础教程攻略-python基础教程(一)

    之所以选择py交易有以下几点:1.python是胶水语言(跨平台),2.python无所不能(除了底层),3.python编写方便(notepad++等文本编辑器就能搞事情),4.渗透方面很多脚本都是 ...

  6. python资料txt下载-python全教程下载-哪里有Python教程txt下载

    跪求[Python教程].Python.Programming.Tutorial.-.1.-.Installing_Python_video种子下载,谢谢 整理打包好的Python教程,里面用模块.函 ...

  7. 一篇文章了解Github和Git教程-AndroidStudio上传Github教程

    前言 为了方便保存自己的代码,下班后可以回家继续进行,自己的码农工作,介绍一下Github. 什么是Github呢? 作为一个编程人员,我觉得得了解一下Github吧! 当然,如果你放弃了码农或者技术 ...

  8. jquery.cookie 使用文档,$.cookie() 文档教程, js 操作 cookie 教程文档。

    jquery.cookie 使用文档,$.cookie() 文档教程, js 操作 cookie 教程文档. jquery.cookie中的操作: jquery.cookie.js是一个基于jquer ...

  9. ASP.NET Core 基础教程 - ASP.NET Core 基础教程 - 简单教程,简单编程

    原文:ASP.NET Core 基础教程 - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 是对 ASP.NET 有重大意义的一次重新设计.本章节我们将介绍 A ...

最新文章

  1. Leangoo看板Jenkins配置指南
  2. Cocos 2d-X Lua 游戏添加苹果内购(一) 图文详解准备流程
  3. 三维重建2: 地图构建-三角测量
  4. 我会永远永远的爱你,直到你不爱我的那一天
  5. 有序链表转换二叉搜索树
  6. Hierarchical line matching based on Line–Junction–Line structure
  7. 【项目3-2】多肉植物网站
  8. java中是否可以覆盖over_”static”关键字是什么意思?Java中是否可以覆盖(override)一个private或者是static的方法?...
  9. android 手机内存uri_Android通过Uri转化为本地绝对路径的方案(全版本适配4.1-7.0)...
  10. 使用Python模块webbrowser实现自动打开网页/刷新网页
  11. 如何将html页面打印出来,网页太长如何全部打印_怎样打印整个网页内容-win7之家...
  12. 案例分享:陕西西安599条背街小巷改造提升,推行“多杆合一”
  13. apple tv 开发_如何在Apple TV上禁用Siri和定位服务
  14. mysql 根据经纬度查询范围点
  15. Source Insight乱码解决方案
  16. 厦门大学计算机网络实验三
  17. 通过位运算来进行2的幂运算
  18. 360软件管家解除文件关联
  19. BERT-Whole Word Masked(WWM)
  20. elasticsearch批量插入数据的时候出现java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection

热门文章

  1. MySQL设置默认编码
  2. 用js内置对象XMLHttpRequest 来用ajax
  3. WPF and Silverlight 学习笔记(二十二):使用代码实现绑定、绑定数据的验证
  4. [转载] python更新numpy_Python numpy从1.6更新到1.8
  5. [转载] 细思极恐的星座分析(下)- 外太空?内子宫?人类的天赋从何而来?
  6. [转载] Java中为什么要有重载现象
  7. Spring系列(三) Bean装配的高级技术
  8. Hibernate框架学习2
  9. 从今天开始 好好规划自己
  10. 当网卡收到的包的目的地址是主机上另一个网卡的地址.arp总结