KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * DisplayGroupWizardIntroAction.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
14 /**
15  *
16  * @author bhm
17  */

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