可以使用脚本编制和 wsadmin 工具配置 Portlet 片段高速缓存。
开始之前
开始本任务前,wsadmin 工具必须正在运行。有关启动 wsadmin 工具的更多信息,请参阅“启动 wsadmin 脚本编制客户机”主题。
关于此任务
要点: 如果使用 wsadmin 工具来启用 Portlet
片段高速缓存,那么必须确保还启用了 Servlet 高速缓存。相似地,如果使用 wsadmin 工具来禁用 Portlet 片段高速缓存,那么必须确保还禁用了 Servlet 高速缓存。这两个高速缓存功能的设置必须保持同步。如果使用管理控制台来启用或禁用了 Portlet 片段高速缓存,那么会自动为您考虑同步问题。
过程
- 找到服务器对象。以下示例选择找到的第一台服务器:
使用 Jacl:
set s1 [$AdminConfig getid /Server:server1/]
使用 Jython:
s1 = AdminConfig.getid('/Server:server1/')
- 列示 Web 容器并将它们分配给 wc 变量,例如:
使用 Jacl:
set wc [$AdminConfig list PortletContainer $s1]
使用 Jython:
wc = AdminConfig.list('PortletContainer', s1)
- 请将 enablePortletCaching 属性设置为 true 并将它指定给 serEnable 变量,例如:
使用 Jacl:
set serEnable "{enablePortletCaching true}"
使用 Jython:
serEnable = [['enablePortletCaching', 'true']]
- 启用高速缓存,例如:
使用 Jacl:
$AdminConfig modify $wc $serEnable
使用 Jython:
AdminConfig.modify(wc, serEnable)