SpringExt

自定义Spring Schema的例子

基于Spring可扩展Schema提供自定义配置支持

使用SpringExt扩展Webx的示例

扩展点和捐献

一个namespace下可以声明多个element。

扩展点:将namespace和接口关联起来。
捐献:将element和实现关联起来。

webx archetype

tutorial1

tutorial11.PNG
mvn archetype:generate -DgroupId=com.alibaba.webx -DartifactId=tutorial1 -Dversion=1.0-SNAPSHOT -Dpackage=com.alibaba.webx.tutorial1 -DarchetypeArtifactId=archetype-webx-quickstart -DarchetypeGroupId=com.alibaba.citrus.sample -DarchetypeVersion=1.8 -DinteractiveMode=false

login-webx3-tutorial

该示例是tutorial1示例中的“5. Form Validation”部分的内容。

login-webx3-tutorial.PNG
mvn archetype:generate -DgroupId=com.alibaba.webx -DartifactId=login-webx3-tutorial -Dversion=1.0-SNAPSHOT -Dpackage=com.alibaba.webx.tutorial -DarchetypeArtifactId=archetype-webx-quickstart -DarchetypeGroupId=com.alibaba.citrus.sample -DinteractiveMode=false

petstore

git clone https://github.com/webx/citrus-sample.git
cd citrus-sample/petstore
mvn clean install
cd web
mvn jetty:run-war

第五章

web应用根目录
就是指的是web项目的根目录。
/WEB-INF/web.xml
上述的/不是相对于操作系统而言,而是针对web项目而言。

charset

每一端都有input chaset 和output charset。这就好比socket通信,每一端都有输入流和输出流。

如何将url转为target

AnalyzeURLValve:取得target,action,actionEvent。
(1)通过request.getServletPath()+request.getPathInfo()获取请求的pathInfo,并通过MappingRuleService将pathInfo转为target。
(2)取得请求中的action参数。通过MappingRuleService得到最后的action。
(3)得到请求中的actionEvent。

对开发者的要求:
(1)配置MappingRuleService的映射规则。即<services:mapping-rules>

如何将target映射到action

PerformActionValve:根据action参数找到具体的action类,然后执行其execute()方法。
ModuleLoaderService.getModule(action).execute()
Module就是一个含execute()方法的接口。

<direct-module-rule>元素表示直接映射module,这是最简单的模块映射规则。
它映射Module的原理是:将URL路径"/"替换成".",除去文件名后缀,将最后一个单词首字母改成大写,以符合模块命名的规则。
比如http://abc.com/helloapp/path/hello.htm

webx根据你访问的URL target “path/hello.htm”,定位到 Module “path.hello.class”

    <services:module-loader>
<ml-factories:class-modules>
<search-packages type="$1" packages="com.alibaba.sample.petstore.web.common.module.*" />
</ml-factories:class-modules>
</services:module-loader>

webx相关blog

petstore-web的src目录如下:

src
└─main
├─java
│ └─com
│ └─alibaba
│ └─sample
│ └─petstore
│ └─web
│ ├─common
│ │ └─util
│ ├─home
│ │ └─module
│ │ └─screen
│ ├─servlet
│ ├─store
│ │ └─module
│ │ ├─action
│ │ ├─control
│ │ └─screen
│ └─user
│ └─module
│ ├─action
│ └─screen
└─webapp
├─common
│ └─templates
│ ├─layout
│ └─screen
├─home
│ ├─css
│ ├─images
│ └─templates
│ ├─control
│ ├─layout
│ └─screen
├─META-INF
│ └─autoconf
├─store
│ ├─css
│ ├─images
│ └─templates
│ ├─control
│ ├─layout
│ └─screen
│ └─edit
├─user
│ ├─css
│ └─templates
│ ├─control
│ ├─layout
│ └─screen
└─WEB-INF
├─common
│ └─$petstore_upload
├─home
├─store
└─user

WEB-INF目录

main下的两个目录分别是java和webapp。

从代码结构来看,整个petstore-web分成了3个模块(子应用),分别是home、user、store等3个模块。另外还有一个公共模块common。

java部分

java部分在com.alibaba.sample.petstore.web下有四个主要的子包common、home、user、store,分别对应4个模块。
然后在每个子包下面才是action、control、screen等module。

com.alibaba.sample.petstore.web.子模块.module.action.LoginAction;
com.alibaba.sample.petstore.web.子模块.module.screen.LoginAction;
com.alibaba.sample.petstore.web.子模块.module.control.LoginAction;

webapp部分

webapp目录下有4个子模块目录和WEB-INF目录。
四个子模块目录分别是common、home、user、store。每个里面都是存放的该模块的css、img、template等资源。

WEB-INF目录下的内容:

  • web.xml
  • 3个子模块目录(每个里面都是form.xml),每个子模块对应一个webx-*.xml
  • 公共子目录common,里面存放了共用的配置文件;以及一个总的webx.xml

每个子模块的webx-*.xml中都有一个装载模块的配置<services:module-loader>,对应着java中的package。

例如webx-home.xml中的配置片段是:<search-packages type="$1" packages="com.alibaba.sample.petstore.web.home.module.*" />
例如webx-user.xml中的配置片段是:<search-packages type="$1" packages="com.alibaba

webx roadmap的更多相关文章

  1. (转载)The One Sign You Will Be Rich-(by Brian de Haaff Founder and CEO Aha! -- world's #1 product roadmap software)

    When I was studying Philosophy at Berkeley, a friend told me that she could tell who was going to be ...

  2. 阿里巴巴开源技术 WebX

    0. WebX项目目前已开源, 项目开源地址:https://github.com/webx/citrus-sample.git 项目参考文档:http://www.openwebx.org/docs ...

  3. 深入webx框架(li)

    目录 1.Webx简介 2.创建webx应用   一.Webx简介 Webx本质上就是一个Web框架,它建立在Java Servlet API基础之上.上图所示是webx的架构图.webx本身类似于s ...

  4. Deep Learning Papers Reading Roadmap

    Deep Learning Papers Reading Roadmap https://github.com/songrotek/Deep-Learning-Papers-Reading-Roadm ...

  5. 2016年 Delphi Roadmap

    2016年delphi Roadmap 发布,这也是新公司的第一次发布路线图. 虽然稍微晚点( 原来说是1月份发布路线图),至少比过去积极点.喧嚣多年的靴子终于落地. Linux 的支持终于正式公布. ...

  6. .NET Core Roadmap

    This post was written by Scott Hunter. It has been about two weeks since we shipped .NET Core / ASP. ...

  7. gRPC 的 RoadMap 20160325 更新

    gRPC是一个高性能.通用的开源RPC框架,其由Google主要面向移动应用开发并基于HTTP/2协议标准而设计,基于ProtoBuf(Protocol Buffers)序列化协议开发,且支持众多开发 ...

  8. 我的WebX框架学习总结与心得分享

    最近学习了webx框架, 利用博客园跟大家分享一下自己的学习心得; 周建旭 2014-08-21 网上关于webx的资料少的可怜, 怎么办?  这种情况下不用去求助别人求人只会耽误时间, 不用畏惧; ...

  9. Webx常用接口

    最近在学Webx框架, 在了解webx的工作流程后, 必须要会使用自带的接口和类 常用的 Navigator  这个接口中只有两种类型的方法, 及重定向与转发, 一般用在screen包下的类(注意:s ...

随机推荐

  1. Vue的router使用

    <div id="app"> <router-link to="/home">home</router-link> < ...

  2. [转帖]知乎专栏:正确使用 Docker 搭建 GitLab 只要半分钟

    正确使用 Docker 搭建 GitLab 只要半分钟 https://zhuanlan.zhihu.com/p/49499229 很多程序员在内网搭建 gitlab 都搭建的坑坑洼洼,不支持 htt ...

  3. [转帖]总结ORACLE系统视图及表大全

    总结ORACLE系统视图及表大全:dba_开头.....dba_users 数据库用户信息dba_segments 表段信息dba_extents 数据区信息dba_objects 数据库对象信息db ...

  4. IBM推出新一代云计算技术来解决多云管理

    IBM 云计算论坛在南京举行,推出了一项全新的开放式技术,使用户能够更加便捷地跨不同云计算基础架构来管理.迁移和整合应用. IBM 多云管理解决方案(Multicloud Manager)控制面板 据 ...

  5. liunx速查

    文件和目录 Linux 主要目录速查表 /:根目录,一般根目录下只存放目录,在 linux 下有且只有一个根目录,所有的东西都是从这里开始 当在终端里输入 /home,其实是在告诉电脑,先从 /(根目 ...

  6. SpringBoot基础入门

    1.SpringBoot核心相关内容 1.1入口类 SpringBoot通常有一个入口类*Application,内部有一个main方法,是启动SpringBoot的入口.使用@SpringBootA ...

  7. BZOJ5286: [Hnoi2018]转盘 (线段树)

    题意 给你绕成一圈的物品共 \(n\) 个 , 然后从其中一个开始选 , 每次有两种操作 , 一是继续选择当前物品 , 二是选择这个后一个物品 . 选择后一个物品要求当前的时刻大于后一个的 \(T_i ...

  8. 自学Aruba2.2-Aruba Web UI --Monitoring面板介绍

    点击返回:自学Aruba之路 自学Aruba2.2-Aruba Web UI --Monitoring面板介绍 1. Monitoring面板-NETWORK Network Summary      ...

  9. 一个数学不好的菜鸡的快速沃尔什变换(FWT)学习笔记

    一个数学不好的菜鸡的快速沃尔什变换(FWT)学习笔记 曾经某个下午我以为我会了FWT,结果现在一丁点也想不起来了--看来"学"完新东西不经常做题不写博客,就白学了 = = 我没啥智 ...

  10. 调用Microsoft.Office.Interop.Word生成自定义Word文档

    具体思路: 1.先制作Word模版,使用文本框+书签的方式来设计模版: 2.模版制作完之后,根据模版生成新文件,使用File.Copy方法,生成.doc格式新文件: 3.后台取得数据,参照网页渲染的方 ...