KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * DisplayRenameFileInputAction.java
3  *
4  * Created on June 14, 2003, 9:46 PM
5  */

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

21 public final class DisplayRenameFileInputAction extends Action{
22     
23     /** Creates a new instance of DisplayRenameFileInputAction */
24     public DisplayRenameFileInputAction() {
25     }
26     
27     public ActionForward execute(ActionMapping mapping,
28     ActionForm form,
29     HttpServletRequest request,
30     HttpServletResponse response)
31     throws IOException, ServletException {
32         // Extract attributes we will need
33
Locale locale = getLocale(request);
34         ActionErrors errors = new ActionErrors();
35         
36         // first check if the user has a connection
37
Connection c = (Connection)request.getSession().getAttribute("connection");
38         if (c == null) {
39             errors.add(ActionErrors.GLOBAL_ERROR,
40             new ActionError("error.not.logged.in"));
41             saveErrors(request, errors);
42             return mapping.findForward("logon");
43         }
44         
45         WebTalkRelatedTasks menu = new WebTalkRelatedTasks();
46         menu.addLink(new LinkAttribute("Upload File", "upload_file_input"));
47         menu.addLink(new LinkAttribute("Delete File", "delete_file_input"));
48         
49         request.setAttribute("menu", menu);
50         return (new ActionForward(mapping.getInput()));
51     }
52     
53 }
54
Popular Tags