if (result.hasErrors()) {
return JSP_EDIT;
}
Feature feature;
IJpaFactory<Feature> strategy = new FeatureFactory(new J2eeConfig());
strategy.setTransactional(true);
try {
if (form.getId() == 0) {
feature = new Feature();
} else {
feature = strategy.get(form.getId());
}
feature.setOrder(form.getOrder());
feature.setSummary(form.getSummary());
feature.setTitle(form.getTitle());
feature.setTrailer(form.getTrailer());
feature.setTrailerHeight(form.getTrailerHeight());
feature.setTrailerWidth(form.getTrailerWidth());
feature.setWebsiteUrl(form.getWebsiteUrl());
if (form.getId() == 0) {
strategy.add(feature);
} else {
strategy.refresh(feature);
}
} finally {
strategy.close();
}
return JSP_DISPLAY;
}