websphere commerce suite中DataBean的使用方法一
来源:互联网 发布:基于php视频购物系统 编辑:程序博客网 时间:2024/05/01 21:10
DataBean中定义了一系列的属性和set,get方法,用于在页面上显示DataBean中的属性值。使用方法一:
1. 自定义的DataBean必须继承SmartDataBeanImpl或者实现SmartDataBean接口。
2. 在自定义的Command接口中,定义页面传递参数的set,get方法,然后在Command实现类中定义这些set,get方法。
3. 在Command实现类中定义validateParameters()方法,用于验证URL中参数的值,并且填充自己的属性,如下:
public void validateParameters()throws ECApplicationException{
final String strMethodName = "validateParameters";
TypedProperty tpy = this.getRequestProperties();
try{
setUsername(tpy.getString("username"));
}catch(ParameterNotFoundException e){
throw new ECApplicationException (ECMessage._ERR_CMD_MISSING_PARAM, this.getClass().getName(), strMethodName, ECMessageHelper.generateMsgParms(e.getParamName()));
}
}
4. 在performExecute()方法中设置DataBean中属性的值,以便页面可以使用。如下:
//使用DataBean
MyNewDataBean myDB = new MyNewDataBean();
myDB.setUserName(this.getUsername());
response.put("MyDBInstance", myDB);
5. 在页面上进行显示:
<c:out value="${MyDBInstance.userName}"/>
- websphere commerce suite中DataBean的使用方法一
- Websphere Commerce Suite 架构开发一个模块的流程
- Websphere Commerce Suite 架构开发一个模块的流程
- POWER7 的 WebSphere Commerce 性能
- WebSphere Commerce 中邮件服务器使用探讨
- 专家访谈: WebSphere Commerce
- 专家访谈: WebSphere Commerce
- websphere commerce - order status
- DataBean
- 对POWER7 的 WebSphere Commerce 部署的提示和最佳体验
- install websphere commerce version 7.0.0.1
- WebSphere commerce Mobile starter stores 页面
- IBM websphere commerce后台开发步骤
- Websphere commerce 订单状态初步释义
- WebSphere Portal中多层Placebar主题的开发(一)
- commerce kickstart中可禁用的不常用模块
- WebSphere Commerce 项目实施经验谈【转自IT168】
- appServer IBM WebSphere / WAS 7 / 8.5 / was commerce
- Introducing initramfs, a new model for initial RAM disks
- OpenGL学习:列表
- Webkit家族漫谈
- linux下resin的安装和配置
- 专家教你安装 MySQL与MySQL GUI Tools
- websphere commerce suite中DataBean的使用方法一
- Tsc打印机编程
- Asp.Net 上传大文件专题--概述:上传大文件的难点
- TreeView绑定xml
- 28.3 数据库管理
- SQLServer 2005 中的类型 与 C# 中的类型 对应 关系
- Sys.WebForms.PageRequestManagerParserErrorException 错误的解决办法
- CSDN博客开通一周年啦
- ARM存储管理单元MMU和存储保护单元MPU