ActionForm actionForm,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ApplicationConfig appConfig = context.getApplicationConfig();
GraphForm form = (GraphForm)actionForm;
String[] attributes = form.getAttributes();
String[] displayNames = request.getParameterValues("displayNames");
List<GraphAttributeConfig> graphAttrConfigs =
new ArrayList<GraphAttributeConfig>(attributes.length);
for(int i=0; i<attributes.length; i++){
Expression expression = new Expression(attributes[i]);
GraphAttributeConfig graphAttrConfig = new GraphAttributeConfig(
expression.getMBeanName(),expression.getTargetName(),
displayNames[i]);
graphAttrConfigs.add(graphAttrConfig);
}
String graphId = request.getParameter(RequestParams.GRAPH_ID);
GraphConfig graphConfig = null;
if(graphId==null || graphId.equals("")){
graphConfig = new GraphConfig(GraphConfig.getNextGraphId(),
form.getGraphName(), Long.parseLong(form.getPollInterval()),
appConfig, graphAttrConfigs);
graphConfig.setYAxisLabel(form.getYAxisLabel());
if(form.getScaleFactor() != null){
graphConfig.setScaleFactor(new Double(form.getScaleFactor()));
graphConfig.setScaleUp(Boolean.valueOf(form.getScaleUp()));
}
appConfig.addGraph(graphConfig);
}else{
graphConfig = appConfig.findGraph(graphId);
graphConfig.setName(form.getGraphName());
graphConfig.setAttributes(graphAttrConfigs);
graphConfig.setPollingInterval(Long.parseLong(form.getPollInterval()));
graphConfig.setYAxisLabel(form.getYAxisLabel());
if(form.getScaleFactor() != null){