Refactor Contacts Sample to use new ACL security.

This commit is contained in:
Ben Alex
2004-11-15 03:25:39 +00:00
parent bc9a599bf7
commit 6e687d47d4
39 changed files with 1788 additions and 1044 deletions

View File

@@ -17,6 +17,7 @@ package sample.contact;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.bind.RequestUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
@@ -28,7 +29,7 @@ import javax.servlet.http.HttpServletResponse;
/**
* Controller to delete a contact page.
* Controller to delete a contact.
*
* @author Ben Alex
* @version $Id$
@@ -57,8 +58,8 @@ public class DeleteController implements Controller, InitializingBean {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Integer id = new Integer(request.getParameter("id"));
Contact contact = contactManager.getById(id);
int id = RequestUtils.getRequiredIntParameter(request, "contactId");
Contact contact = contactManager.getById(new Integer(id));
contactManager.delete(contact);
return new ModelAndView("deleted", "contact", contact);