Use the Jython or Jacl scripting language to implement
pattern matching when installing, updating, or editing an application.
Pattern matching simplifies the task of supplying required values
for certain complex options by allowing you to pass in asterisk (*)
to all of the required values that cannot be edited.
Before you begin
There are two ways to complete this task. This topic uses
the AdminApp object to install enterprise applications. Alternatively,
you can use the scripts in the AdminApplication script library to
install, uninstall, and administer your application configurations
with many options, including pattern matching.
Scripting 程式庫提供一組自動執行最常見管理功能的程序。
您可以個別執行每個 Script 程序,也可以將若干程序結合起來,以快速開發新的 Script。
Procedure
- Install each web application archive (WAR) and Java™ archive file to the application server.
- 啟動 wsadmin Scripting 工具。
- Install each web application archive (WAR) and Java archive file to the application server,
as the following examples demonstrate:
- Using Jython:
AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*',
'.*', 'WebSphere:cell=myCell,node=myNode,server=myServer']]])
- Using Jacl:
$AdminApp install DefaultApplication.ear {-appname TEST -MapModulesToServers
{{.* .* WebSphere:cell=myCell,node=myNode,server=myServer}}}
- Save your configuration changes.
請利用下列指令範例來儲存您的配置變更:
AdminConfig.save()
- Install each WAR file to the myServer server
on the myNode node and each JAR file to the yourServer server
on the yourNode node.
- 啟動 wsadmin Scripting 工具。
- Install the WAR and JAR files to different application
server management scopes, as the following examples demonstrate:
Using Jython:
AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*',
'.*.war,.*', 'WebSphere:cell=myCell,node=myNode,server=myServer'], ['.*', '.*.jar,.*',
'WebSphere:cell=myCell,node=yourNode,server=yourServer']]])
Using Jacl:
$AdminApp install DefaultApplication.ear {-appname TEST -MapModulesToServers
{{.* .*.war,.* WebSphere:cell=myCell,node=myNode,server=myServer}
{.* .*.jar,.* WebSphere:cell=myCell,node=yourNode,server=yourServer}}}
- Save your configuration changes.
請利用下列指令範例來儲存您的配置變更:
AdminConfig.save()