The module XML file
位置:src/main/java/包/applicationScaffold.gwt.xml
由于Roo的项目必须是maven构建的,所以有固定的src目录结构;名字也是自动生成的(@question希望在使用Roo命令时可以修改
);
内容:
模块:applicationScaffold
继承User
继承Standard theme
继承Activity
继承Place
继承Inject
:gwt的依赖注入模块,项目名字叫Gin
,是基于Guice
的
继承RequestFactory
:可以理解为客户端entity管理
继承CellView
继承Text
继承Logging
entry-point:**.client.scaffold.Scaffold
源client
源shared
公共public
下面配置表示对InjectorWrapper的注入会根据客户端不同而采用Desktop或者Mobile的InjectorWapper
<define-property name="mobile.user.agent" values="mobilesafari, none"/>
<property-provider name="mobile.user.agent">
<![CDATA[
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("webkit") != -1 && ua.indexOf("mobile") != -1) {
return "mobilesafari";
}
var isMobile;
// Look for the m as a url argument
if (isMobile == null) {
var args = location.search;
var startMobile = args.indexOf("m");
if (startMobile >= 0) {
var mobile = args.substring(startMobile);
var begin = mobile.indexOf("=") + 1;
var end = mobile.indexOf("&");
if (end == -1) {
end = mobile.length;
}
isMobile = mobile.substring(begin, end);
}
}
if (isMobile){
return "mobilesafari";
}
return "none";
]]>
</property-provider>
The Host Page
位置:src\main\webapp\ApplicationScaffold.html
内容:
meta tag
css: 没有指定css
js: applicationScaffold/applicationScaffold.nocache.js
span: 显示loading...
The Entry Point Class
位置:src/包.client.scaffold.Scaffold
内容:
实现EntryPoint.onModuleLoad():通过DesktopInjectorWrapper得到DesktopInjector得到ScaffoldDesktopApp
对象并调用该对象的run方法。
The Main App Class
位置:src/包.client.scaffold.ScaffoldDesktopApp(ScaffoldMobileApp)
内容:
- 通过正常Inject注入的属性包括ScaffoldDesktopShell shell,placeHistoryFactory,applicationMasterActivities,applicationDetailsActivities。
- 通过BindingModule注入的属性包括eventBus,ApplicationRequestFactory
requestFactory,placeController;由于这些类需要通过GWT来create,所以需要用到BindingModule设置。
- 定义run
方法作为整个app的入口。
The Request Factory
位置:src/包.client.managed.request
内容:
-
RequestFactory
<|--
ApplicationRequestFactory
接口:Request的工厂,每个Entity都应该有对应的Request创建方法在这个工厂里,同时它还包括了UserInformationRequest(User模块),LoggingRequest(Logging模块);。
-
RequestContext
<|--*Request
接口:定义所有在客户端可以访问的entity*的crud+finding类方法。
-
EntityProxy
<|--*Proxy
接口:对entity*在客户端的代理,类似DTO。
- ApplicationEntityTypesProcessor<T> @TODO
。
The IoC (Gin)
位置:src../包.client.scaffold.ioc
内容:
- InjectWapper接口(包含2个实现类 DesktopInjectorWrapper /
MobileInjectorWrapper):Inject类的工厂;
- ScaffoldInjector接口,继承自Ginjector(包含2个子接口DesktopInjector/MobileInjector):Inject类,使用指定的Binding Module类来生成依赖注入后的对象,由于客户端无法使用Guice的Inject的getInstance方法,所以在Gin中要定义Inject接口,并通过@GinModules定义具体的Binding Module;
- ScaffoldModule类,继承自AbstractGinModule:Binding Module类,通过config函数定义依赖关系。
分享到:
相关推荐
上次上传的没有包含数据库表这次补上;smartGwt、spring和Mybatis的整合
gwt+spring+hibernate整合例子,导入myeclipse中(要安gwt插件)即可用,数据库自己去代码中查看。包是精简版的,去掉很多不必要的包
GWT整合spring网上资源十分少,版本比较旧,晚点进行更新
一个简单的maven项目,演示 smartgwt + spring + hibernate 整合框架
GWT+spring的一个实例 需要插件apache 的maven
smartGwt、spring、Mybatis整合;一个登录和一个分页查询功能;根据用户获取相应的权限;gwt2.4、内付数据表
一个GWT+Spring2+Spring Security2+Hibernate3的实例,数据库为mssql.在/GwtWeb/WebRoot/WEB-INF/lib 目录下RequiredJar.txt有需要用到的库说明 修改一下applicationContext.xml的数据库设定就可以使用
gwt-site, gwtproject.org 网站的网页来源 文档GWT文档是在 http://www.gwtproject.org/doc/latest/DevGuide.html 发布的。引用Markdown 处理器:https://github.com/sirthias/pegdow
各种各样的资源找齐还是要点时间的: 1、下载gwt-ext2.04解压 2、解压本资源,导入Eclipse 3、将解压gwt-ext2.04得到一jar包设入classpath 4、按载图编辑你的src 文件夹
GSH:spring3.1.0M2+Hibernate3.5+GWT2.4+JPA+Annotation+Spring4gwt0.0.1亲手整合,也可以上新浪博客去看 http://blog.sina.com.cn/s/blog_687dfecb0100yrmf.html
介绍gwtrpc-spring项目限制了Spring GWT-RPC。 其目的是提供后者的简化和更新版本。得到它Spring GWT-RPC在Maven Central上发布: < dependency> < groupId>fr.sertelon.spring</ groupId> < artifactId>spring-gwt...
GWT与Spring整合,分析的很透彻,有代码过程。
完整代码,绝对能用:Spring和...GWT部分集成了Spring的Service(网上的例子很少,要不代码不全,要不不能使用,这个保证完全可以使用)。请注意各个配置文件,程序所用的包都在WEB-INF下的图片上,请自行下载。
基于java的开发源码-Spring4GWT.zip 基于java的开发源码-Spring4GWT.zip 基于java的开发源码-Spring4GWT.zip 基于java的开发源码-Spring4GWT.zip 基于java的开发源码-Spring4GWT.zip 基于java的开发源码-Spring4GWT....
开发框架: gwt1.4.6 + spring2.5 + mysql5.0 开发工具: Eclipse3.4 Cypal Studio for GWT (Eclipse 的一个插件) 实现原理:通过GWT的RPC来调用Spring 传过来的服务器端数据 注意:需要的jar包 * gwt-user.jar ...
Spring Boot GWT 这是一个演示项目,用于展示Spring Boot与GWT的结合。 它使用最新的依赖关系(Spring Boot 2.0.1和GWT 2.8.2)和Java8。可以在找到已部署的应用程序。跑要运行该项目,您必须分别启动Spring Boot和...
Spring4GWT技术资料
一个 gwt 与 spring 集成的例子,本例子通过一个图书查询的功能演示了这两者的集成,希望对你们有帮助.
叉和星演示-gwt-spring 克隆分叉项目 如何从原始回购更新我的回购 git 远程添加上游 git pull 上游主 请注意您是否已经对本地仓库进行了更改!! 如何编译: mvn Eclipse:Eclipse mvn 全新安装 如何导入项目:...
GWT整合SPRING, 愿与大家分享!