Skip to content

Commit

Permalink
Utilize the underlying createCommand method
Browse files Browse the repository at this point in the history
This change will allow the command class to be overridden to support
subclasses of RegisteredServiceImpl
  • Loading branch information
frett committed Oct 12, 2011
1 parent 3e11ee5 commit f0c242b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public RegisteredServiceSimpleFormController(
final IPersonAttributeDao attributeRepository) {
this.servicesManager = servicesManager;
this.personAttributeDao = attributeRepository;
this.setCommandClass(RegisteredServiceImpl.class);
}

/**
Expand Down Expand Up @@ -93,7 +94,7 @@ protected Object formBackingObject(final HttpServletRequest request)

if (!StringUtils.hasText(id)) {
logger.debug("Created new service.");
return new RegisteredServiceImpl();
return this.createCommand();
}

final RegisteredService service = this.servicesManager.findServiceBy(Long.parseLong(id));
Expand Down

0 comments on commit f0c242b

Please sign in to comment.