*************************Web部分*************************
Struts封装
StrutsAction org.springside.core.web.StrutsAction
public class StrutsAction extends DispatchAction {}
第一层封装:StrutsAction,继承于DispatchAction,附带一些Utils函数,另外注册了几个Converter。
使用: 如果不用CRUD操作,可以直接使用StrutsAction.
初始化时,执行的操作:
/***************************************************************************
* 将session中的用户信息取出
*/
protected void initSessionUser(HttpServletRequest request) {
User session_user = (User) request.getSession().getAttribute(Constants.SESSION_USER);
this.session_user = session_user;
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws Exception {
initSessionUser(request);
return super.execute(mapping, form, request, response);
}
增加功能有:
A:设置Struts 中数字<->字符串转换
B:Object和Form之间的copyProperties (bindEntity , bindForm)
C:Save出错的Message (saveError , saveMessage ...)
D:直接输出.html,text,xml (renderText ,renderXXX)
StrutsEntityAction org.springside.core.web.StrutsEntityAction
public abstract class StrutsEntityAction<T, M extends EntityDao<T>> extends StrutsAction implements InitializingBean {}
第二层封装:负责管理单个Entity CRUD操作的Struts Action基类. 子类以以下方式声明,并实现将拥有默认的CRUD操作
此类仅演示一种封装的方式,大家可按自己的项目习惯进行重新封装 目前封装了:
1.index、list、create、edit、view、save、delete 七种action的流程封装;
2.doListEntity、doGetEntity、doNewEntity、doSaveEntity(),doDeleteEntity五种业务函数调用,可在子类重载;
3.initEntity、initForm两个FormBean与业务对象的初始函数及refrenceData,onInitForm,onInitEntity三个回调函数;
4.savedMessage、deletedMessage 两种业务成功信息,可在子类重载。
StrutsEntityAction 详细分析
StrutsECEntityAction org.vicalloy.quickstart.core.web.StrutsECEntityAction
public class StrutsECEntityAction<T, M extends EntityDao<T>> extends StrutsEntityAction {}
第三层封装:
1.加入springside1中的翻页代码. 重载了list方法,加入翻页代码。 (结合Page对象一起使用)
2.简单查询. (研究中...)
StrutsSecurityAction org.vicalloy.quickstart.core.web.StrutsSecurityAction
public class StrutsSecurityAction<T, M extends EntityDao<T>> extends StrutsECEntityAction {}
第四层封装: 提供基础的权限控制。同时记录基本的操作日志。
使用StrutsSecurityAction的例子
public class UserAction extends StrutsSecurityAction<User, UserManager> {}
这一个操作User类的Action.
在类被加载时的初始化操作:
{
functionId = FUNCTIONID; //主权限ID
functionDescn = "用户"; //对操作实体的描述
disabledField.add("loginName"); //设置User类的loginName为不可编辑field
whiteMethod.add("login"); //添加白名单中的方法,在权限基类中不做权限验证。
whiteMethod.add("logout");
}
待续ing...
什么是SpringSide,来这里了解详情!
什么是SpringSide2++,来这里了解详情!
分享到:
相关推荐
该架构的雏形为SpringSide3,本人只是在基础上进行扩展和修缮。由于该架构为本项目正在使用,所以类注释的作者都是本人,而没有改成江南白衣。在这里本人深表歉意。
springside-core-4.3.0.jar 最新版springside-core的jar包
包含core的两个关键jar包,网上难找,分享出来给大家,如果还有其他需要的没有的jar包,可私信我,分享给你
SpringSide3开发环境mini-web项目_3 一共三个压缩包: http://download.csdn.net/source/1725011 http://download.csdn.net/source/1725015 http://download.csdn.net/source/1725311
SpringSide+3.1.4.3项目开发全过程SpringSide+3.1.4.3项目开发全过程SpringSide+3.1.4.3项目开发全过程SpringSide+3.1.4.3项目开发全过程
pom.xml配置 ...mvn install:install-file -DgroupId=org.springside -DartifactId=springside-core -Dversion=4.2.2.GA -Dfile=./springside-core-4.2.2.GA.jar -Dpackaging=jar -DgeneratePom=true
SpringSide3开发环境mini-web项目_2 一共三个压缩包: http://download.csdn.net/source/1725011 http://download.csdn.net/source/1725015 http://download.csdn.net/source/1725311
springside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-3.3.3-all-in-onespringside-...
使用SpringSide 3.1.4.3开发Web项目可参考,也适合初学SpringSide的同学学习,具体SpringSide的安装以及如何使用SpringSide生成java web项目使用步骤可参考:...
springside-joddform-2.0.zip
springside-core-4.1.0.GA的jar包,实际包含springside-core-4.1.0.GA以及springside-core-3.3.4.jar。
springside-core-4.2.3-GA.jar,如果jar包不完整,可能会导致异常:LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context
springside-3.2.2源码springside-3.2.2源码
mini-web_3_MyEclipse开发环境mini-web_MySQL_无初始化sql 一共三个压缩包: http://download.csdn.net/source/1725011 http://download.csdn.net/source/1725015 http://download.csdn.net/source/1725311
springside3-core-3.3.4-sources.jar
springside-core-4.2.2.GA.jar
springside-core-4.2.2是spring,springMVC入门和学习的好东西。
springside3-core-3.2.2
springside-core-4.2.2.GA.jar 包,需要的可以自行下载,
springside-3.2.2-all-in-one.zip springside-3.2.2-all-in-one.zip