HttpServletResponse response)
throws Exception {
AccessController.checkAccess(context.getServiceContext(),
ACL_EDIT_APPLICATIONS);
ApplicationForm appForm = (ApplicationForm)actionForm;
ApplicationConfig config =
ApplicationConfigManager.getApplicationConfig(
appForm.getApplicationId());
assert config != null;
config.setName(appForm.getName());
config.setHost(appForm.getHost());
if(appForm.getPort() != null)
config.setPort(new Integer(appForm.getPort()));
config.setURL(appForm.getURL());
config.setUsername(appForm.getUsername());
final String password = appForm.getPassword();
if(!ApplicationForm.FORM_PASSWORD.equals(password)){
config.setPassword(password);
}
Map<String, String> paramValues = config.getParamValues();
if(appForm.getJndiFactory() != null){
paramValues.put(ApplicationConfig.JNDI_FACTORY, appForm.getJndiFactory());
}else{
paramValues.remove(ApplicationConfig.JNDI_FACTORY);
}
if(appForm.getJndiURL() != null){
paramValues.put(ApplicationConfig.JNDI_URL, appForm.getJndiURL());
}else{
paramValues.remove(ApplicationConfig.JNDI_URL);
}
ApplicationConfigManager.updateApplication(config);