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

Quick Search    Search Deep

Source code: org/acs/damsel/client/slideshow/ViewSlideShowAction.java


1   package org.acs.damsel.client.slideshow;
2   
3   import org.apache.struts.action.*;
4   import javax.servlet.http.*;
5   
6   public class ViewSlideShowAction extends Action {
7     public ActionForward execute (ActionMapping actionMapping,
8                                  ActionForm actionForm,
9                                  HttpServletRequest httpServletRequest,
10                                 HttpServletResponse httpServletResponse) {
11      ViewSlideShowForm viewSlideShowForm = (ViewSlideShowForm) actionForm;
12      int numViewing = viewSlideShowForm.getNumViewing();
13  
14      if (viewSlideShowForm.getButtonType().equals("cycle")) {
15        numViewing ++;
16        viewSlideShowForm.setNumViewing(numViewing%viewSlideShowForm.getNumAssets());
17      }
18  
19      else if (viewSlideShowForm.getButtonType().equals("back")) {
20        numViewing--;
21        viewSlideShowForm.setNumViewing(numViewing);
22      }
23      else if (viewSlideShowForm.getButtonType().equals("next")) {
24        numViewing++;
25        viewSlideShowForm.setNumViewing(numViewing);
26      }
27      httpServletRequest.getSession().setAttribute("viewSlideShowForm", viewSlideShowForm);
28      return actionMapping.findForward("success");
29    }
30  }