Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/acs/damsel/client/help/HelpAction.java


1   package org.acs.damsel.client.help;
2   
3   import org.apache.struts.action.*;
4   import javax.servlet.http.*;
5   import java.util.*;
6   
7   public class HelpAction extends Action {
8     /**
9      * Selects the appropriate help page.  This is done by creating a forward
10     * based on the referring page.
11     * i.e., getHelpForsearch.do
12     * or
13     * getHelpFordiscovery.do
14     */
15    public ActionForward execute(ActionMapping actionMapping,
16                                 ActionForm actionForm,
17                                 HttpServletRequest httpServletRequest,
18                                 HttpServletResponse httpServletResponse) {
19  
20      // make referer equal to the page we're coming from, sans path
21      String referer = (String) httpServletRequest.getSession().getAttribute("referer");
22      referer = referer.substring(referer.lastIndexOf("/") + 1);
23  
24      // if there isn't a help page for the referring page, forward to the help
25      // error page
26      if( (actionMapping.findForward("getHelpFor" + referer)) == null)
27        return (actionMapping.findForward("helpError"));
28  
29      return (actionMapping.findForward("getHelpFor" + referer));
30    }
31  }