为什么2007是金猪年???
2008-01-03 09:59
381 查看
struts2 的demo 中的employee层可以清晰的暂时struts希望给开发者带来的架构
--------------------------
EmployeeAction <-- AbstractCRUDAction (web 层)
^
|
EmployeeDao <-- AbstractDao <-- Dao (Domain 层,demo中也作为service存在于spring容器中)
^
|
Employee <--IDEntity
--------------------------
struts.xml 配置
/empmanager/listSkills.jsp
/empmanager/editSkill.jsp
/empmanager/editSkill.jsp
edit.action?skillName=${currentSkill.name}
/empmanager/editSkill.jsp
edit.action?skillName=${currentSkill.name} 这里展现了struts2具有良好的url特性,比起ww的crud!edit让人舒服多了
/empmanager/listEmployees.jsp
{1}
/empmanager/editEmployee.jsp
execute
/empmanager/editEmployee.jsp
edit-${currentEmployee.empId}.action
/empmanager/editEmployee.jsp
edit-${currentEmployee.empId}.action
-----------------------------
每一个action有自己的properties文件,非常便于管理和代码生成,
当然也有一个全局的globalMessages.properties来存放一些save,delete这些都一样的字符
employee=Employee
employee.firstName=First Name
employee.lastName=Last Name
employee.description=Description
employee.id.required=Id is required
employee.lastName.required=Last Name is required
employee.birthDate.required=Birthdate is required
employee.backtolist=Back to Employee List
每个action自己的validation
http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
true
--------------------------------
DAO是spring的bean,spring默认作为struts2的业务组件容器
在struts.properties中struts.objectFactory = spring
由于这里是autowire,Autowiring means to look for objects defined in Spring with the same name as your object property
所以action中所有用到IoC的地方,都会自动注入(因为action本质也是bean,下面会讲到)
wire有四种方法:name, type, auto, constructor
----------------------------------
struts2中的每一个action,也就是struts.xml里面声明的action,最终都将作为spring中的一个bean完成请求。
如果你不做额外的设定,struts2会自动生成这个bean。
如果你有特殊的需要,还可以在applicationContext.xml自己声明这个bean
你必须根据需要来决定是否再次声明
struts.xml
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
这个foo,在applicationConext.xml中没有声明,struts会自动生成一个bean
foo.ftl
这个foo,在applicationConext.xml中声明了,struts会使用下面配置
bar.ftl
applicationConext.xml
http://www.springframework.org/dtd/spring-beans.dtd">
...
-------------------------
无缝集成ajax
只要声明了theme="ajax",该标签控件的操作就被转换成ajax,请求发送到AjaxRemoteForm
Configured Editor configuration:
textGroup;|;justifyGroup;|;listGroup;|;indentGroup
------------------------
集成了多种模板
jsp,velocity,freemaker
------------------------
struts2 继承了ww2的优良传统,并且摈弃了ww2的一些缺陷,也可以看成是对ww2的一次重购。
无疑是目前最主流,最强大的MVC框架了。
它实现了和spring的完美结合
集成了ajax(dojo+dwr)
其插件支持jasperreports,jfreechart
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1504218
--------------------------
EmployeeAction <-- AbstractCRUDAction (web 层)
^
|
EmployeeDao <-- AbstractDao <-- Dao (Domain 层,demo中也作为service存在于spring容器中)
^
|
Employee <--IDEntity
--------------------------
struts.xml 配置
/empmanager/listSkills.jsp
/empmanager/editSkill.jsp
/empmanager/editSkill.jsp
edit.action?skillName=${currentSkill.name}
/empmanager/editSkill.jsp
edit.action?skillName=${currentSkill.name} 这里展现了struts2具有良好的url特性,比起ww的crud!edit让人舒服多了
/empmanager/listEmployees.jsp
{1}
/empmanager/editEmployee.jsp
execute
/empmanager/editEmployee.jsp
edit-${currentEmployee.empId}.action
/empmanager/editEmployee.jsp
edit-${currentEmployee.empId}.action
-----------------------------
每一个action有自己的properties文件,非常便于管理和代码生成,
当然也有一个全局的globalMessages.properties来存放一些save,delete这些都一样的字符
employee=Employee
employee.firstName=First Name
employee.lastName=Last Name
employee.description=Description
employee.id.required=Id is required
employee.lastName.required=Last Name is required
employee.birthDate.required=Birthdate is required
employee.backtolist=Back to Employee List
每个action自己的validation
http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
true
--------------------------------
DAO是spring的bean,spring默认作为struts2的业务组件容器
在struts.properties中struts.objectFactory = spring
由于这里是autowire,Autowiring means to look for objects defined in Spring with the same name as your object property
所以action中所有用到IoC的地方,都会自动注入(因为action本质也是bean,下面会讲到)
wire有四种方法:name, type, auto, constructor
----------------------------------
struts2中的每一个action,也就是struts.xml里面声明的action,最终都将作为spring中的一个bean完成请求。
如果你不做额外的设定,struts2会自动生成这个bean。
如果你有特殊的需要,还可以在applicationContext.xml自己声明这个bean
你必须根据需要来决定是否再次声明
struts.xml
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
这个foo,在applicationConext.xml中没有声明,struts会自动生成一个bean
foo.ftl
这个foo,在applicationConext.xml中声明了,struts会使用下面配置
bar.ftl
applicationConext.xml
http://www.springframework.org/dtd/spring-beans.dtd">
...
-------------------------
无缝集成ajax
只要声明了theme="ajax",该标签控件的操作就被转换成ajax,请求发送到AjaxRemoteForm
Configured Editor configuration:
textGroup;|;justifyGroup;|;listGroup;|;indentGroup
------------------------
集成了多种模板
jsp,velocity,freemaker
------------------------
struts2 继承了ww2的优良传统,并且摈弃了ww2的一些缺陷,也可以看成是对ww2的一次重购。
无疑是目前最主流,最强大的MVC框架了。
它实现了和spring的完美结合
集成了ajax(dojo+dwr)
其插件支持jasperreports,jfreechart
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1504218
相关文章推荐
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- 为什么2007是金猪年???
- DL/T-2007数据帧为什么上行码为00
- 为什么我装了OCS 2007/LCS 2005之后AD里面没有Communications标签?
- 2007透明加密一览(1)-企业为什么青睐透明加密?
- 为什么我坚持一直使用AutoCAD 2007?(页末附CAD2007及天正单机版下载地址)
- Exchange 2007/2010为什么不能使用全局组来创建邮箱
- 在PPT 2007 中为什么无法输入中文
- Exchange 2007 为什么只能创建通用组?
- 感受2007全国汽车场地赛珠海站
- 项目管理:为什么要编写项目章程
- 快排为什么那样快(转)
- 逻辑回归LR的特征为什么要先离散化