使用PortletData 在 portal中存储数据的方法

[复制链接]
查看11 | 回复1 | 2006-12-27 18:43:27 | 显示全部楼层 |阅读模式
PortletRequest request = event.getRequest();

PortletData portData = request.getData();

// Save value into portlet data

portData.setAttribute("value", value);
// 存数据,actionPerformed用的方法

portData.store();

PortletRequest request = event.getRequest();

PortletDataportData = request.getData();

// Extract value in portlet data into variable

String value = (String) portData.getAttribute("value");//取数据,doview用的方法

// Store the extracted value in the request

request.setAttribute("value", value);

portData.store();
回复

使用道具 举报

千问 | 2006-12-27 18:43:27 | 显示全部楼层
感谢楼主的分享。不过有个建议,开发Portlet最好用JSR 168 API来实现。存贮配置参数用PortletPreference。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行