KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > admin > action > publi > DelPubliAction


1 package org.nextime.ion.admin.action.publi;
2
3 import java.io.IOException JavaDoc;
4
5 import javax.servlet.ServletException JavaDoc;
6 import javax.servlet.http.HttpServletRequest JavaDoc;
7 import javax.servlet.http.HttpServletResponse JavaDoc;
8 import org.apache.struts.action.Action;
9 import org.apache.struts.action.ActionForm;
10 import org.apache.struts.action.ActionForward;
11 import org.apache.struts.action.ActionMapping;
12
13 import org.nextime.ion.framework.business.Publication;
14 import org.nextime.ion.framework.mapping.Mapping;
15
16 public class DelPubliAction extends Action {
17
18     public ActionForward perform(
19         ActionMapping mapping,
20         ActionForm form,
21         HttpServletRequest JavaDoc request,
22         HttpServletResponse JavaDoc response)
23         throws IOException JavaDoc, ServletException JavaDoc {
24
25         String JavaDoc id = request.getParameter("id");
26
27         try {
28             Mapping.begin();
29             Publication.getInstance(id).remove();
30             Mapping.commit();
31         } catch (Exception JavaDoc e) {
32             Mapping.rollback();
33             throw new ServletException JavaDoc(e);
34         }
35
36         return mapping.findForward("success");
37     }
38 }
Popular Tags