KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > communicator > applications > webtalk > controller > DisplayGroupWizardCancelAction


1 /*
2  * DisplayGroupWizardCancelAction.java
3  *
4  */

5
6 package com.quikj.application.communicator.applications.webtalk.controller;
7
8 import com.quikj.application.communicator.admin.model.*;
9 import javax.servlet.http.*;
10 import org.apache.struts.action.*;
11
12 import java.sql.*;
13 import java.util.*;
14
15 /**
16  *
17  * @author bhm
18  */

19 public class DisplayGroupWizardCancelAction extends Action
20 {
21     
22     /** Creates a new instance of DisplayGroupManagementAction */
23     public DisplayGroupWizardCancelAction()
24     {
25     }
26     
27     public ActionForward execute(ActionMapping mapping,
28     ActionForm form,
29     HttpServletRequest request,
30     HttpServletResponse response)
31     {
32         ActionErrors errors = new ActionErrors();
33         
34         Connection c = (Connection)request.getSession().getAttribute("connection");
35         if (c == null)
36         {
37             errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.not.logged.in"));
38             saveErrors(request, errors);
39             
40             return mapping.findForward("logon");
41         }
42         
43         AccountElement element = (AccountElement)request.getSession().getAttribute("userInfo");
44         if (element.isAdminLevel() == false)
45         {
46             errors.add(ActionErrors.GLOBAL_ERROR,
47             new ActionError("error.insufficient.privilege"));
48             saveErrors(request, errors);
49             
50             return mapping.findForward("main_menu");
51         }
52         
53         ArrayList log = (ArrayList) request.getSession().getAttribute("groupWizardLog");
54         
55         if (log == null)
56         {
57             return mapping.findForward("Exit");
58         }
59         
60         return mapping.getInputForward();
61     }
62 }
63
Popular Tags