分享

Struts2 常见插件一览

 Baruch 2017-10-01
  • Breadcrumbs Plugin — 取得所在站点的当前位置. (比说:首页>新闻频道>全名, 这个位置就叫 Breadcrumbs.),可以通过多种方式配置。

  • Codebehind Plugin — 通过 "Page Controller" 的转换,减少 Struts2 的配置文件。
  • Config Browser Plugin — Struts2 运行期间可通过此插件查看 Struts2 的配置情况。

  • Connext Graph Plugin — 允许 Web 应用程序使用 Open Flash Char t图表。 
  • Convention Plugin — 类似于 Codebehind 和 zero-config(零配置) 的转换插件

  • DataVision Plugin — 提供于流行开源报表 DataVision 的支持 
  • EJB3 plugin — 允许 EJB3 的 session beans 注入到 Struts2 的 Actions 里。

  • ExtraTags Plugin — 提供一组额外的标签来辅助 Struts2 核心的 UI 标签功能。 
  • Grails Plugin — 允许 Grails 应用程序运行于Struts2

  • Groovy Plugin — 为 Struts2 提供用 Groovy 语言所写的 Action 以及 Interceptors(拦截器) 的支持。

  • Guice Plugin — 允许采用 Guice 的方式来完成对Actions,Interceptors以及Results的注入依赖 
  • GWT Plugin — 可以通过 Struts2 来调用 Google Web Toolkit。

  • HDIV Plugin — 整合 HDIV (HTTP Data Integrity Validator) 的安全功能。
  • Image Plugin — 一组为图片处理的精品插件(包括有 thumbnails, remote storage, validator)

  • JasperReports Plugin — 允许 Struts2 的回返结果为 JasperReports 报表
  • JFreeChart Plugin —很容易的使 Actions 返回生成的图表
  • JRuby Plugin — 提供对 JRuby 所写 Action 的支持
  • JSCalendar Plugin —Webwork 2.2.6 的 JS 日期插件支持
  • JSF Plugin — 无需额外配置,提供于 JSF 组件支持
  • JSON Plugin — 提供“json” 返回类型,并使 Action 返回 JSON 结果。
  • LightBoxJS Plugin — 用非常简单的方式来使用流行的 LightBoxJS 脚本
  • OSGi Plugin — OSGi 允许 Struts2 应用程序拆分成多个 jars 并可在运行期内进行动态管理。
  • Pell Multipart Plugin — 允许 Struts2 使用 Jason Pell's multipart parser 来处理上传文件。

  • Plexus Plugin —允许采用 Plexus来 创建,注入 Struts2 的 Actions,Interceptors。

  • Portlet Plugin — 通过 Struts2 来开发基于 JSR168 portlets 的 Web 程序。
  • REST Plugin — 提供 Struts2 的 REST 风格。

  • Rome RSS-Atom Plugin —用简单的方式输出 Rome SyndFeed 对象 (包括 RSS, Atom)

  • Scope Plugin — 实现 JBoss Seam 风格中 scoped(域) 双向注入 和会话管理

  • SiteGraph Plugin — 为 Web Application 生成流程图

  • Sitemesh Plugin — 允许 Sitemesh 模板访问 Struts 信息

  • SmartURLs plugin — 类似于 Codebehind 和 zero-config(零配置) 的转换插件

  • Spring MVC Plugin — 允许 Spring MVC 的 Controllers 以及 interceptors 在 Struts2 中执行。

  • Spring Plugin — 允许 Spring 来完成对 Strtus2 的 Actions,Interceptors 和Results 的创建或 autowired

  • Spring Webflow Plugin — 整合 Spring Webflow

  • Struts 1 Plugin — 允许使用现有的 Struts1 中的 Action 和 ActionForms 与 Struts2共存

  • Table Tags Plugin — Struts2 的标签,用来显示表格数据(类似于 DisplayTag)

  • Tiles Plugin — 允许 Actions 返回 Tiles 页面

  • Unified EL Plugin — 允许在 Struts2 中使用 Unified EL 表达式。

  • WebWork2 Plugin — 允许 Webwork 的 Actions 和 Configuration 在 Struts2 中共存。

  • YUI Plugin — 提供基于 YUI 的 Struts2 标签

  • ConfigBrowser插件
    ConfigBrowser插件能够清楚地看到应用下部署的Action以及每个Action详细的映射信息,安装ConfigBrowser插件只需要将struts2-config-browser-plugin-2.*.*jar文件复制到WEB-INF/lib下。
    安装好之后,通过在浏览器中键入http://localhost:8080/WebAppName/config-browser/actionNames.action即可察看系统中所有的action。

    Convention插件
    在配置基本的Struts2框架后,引入Convention插件会简化开发者的配置工作。安装Convention插件非常简单,只需要将struts2-convention-plugin-2.*.*.jar 文件复制到Struts2应用的WEB-INF\lib路径即可。
    对于Convention插件而言,它会自动搜索位于action actions struts struts2包下的所有Java类,Convention插件会把如下两咱Java类当成Action处理
    * 所有实现了com.opensymphony.xwork2.Action的Java类
    * 所有类名以Action结尾的Java类
    按照约定映射Action
    Convention插件里所有Action所在package的父package默认是conventionDefault
    而Action的name属性则根据该Action后缀去掉,映射Action时遵循如下规则:
    1. 如果该Action类包含Action白缀,将该Action类名的Action后缀去掉
    2. 将Action类名的驼峰写法转成划线写法
    例如LoginAction映射成login,GetBooks映射成get-books,AddEmployeeAction映射成add-employee
    按照约定映射Result
    默认情况下,Convention总会到Web应用的WEB-INF/content路径下定位物理资源,定位资源的约定是:actionName+resultcode+suffix。当某个逻辑视图找不到对应的视图资源时,Convention会自动试图使用actionName+suffix作为物理视图资源。
    例如/user/login.action默认的Result资源位于WEB-INF/content/user/login-success.jsp

    • 本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
      转藏 分享 献花(0

      0条评论

      发表

      请遵守用户 评论公约

      类似文章 更多