1 23 24 package com.sun.enterprise.tools.guiframework.event.handlers; 25 26 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 27 import com.sun.enterprise.tools.guiframework.view.HandlerContext; 28 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 29 30 import com.iplanet.jato.CompleteRequestException; 31 import com.iplanet.jato.RequestContext; 32 import com.iplanet.jato.RequestManager; 33 import com.iplanet.jato.view.View; 34 import com.iplanet.jato.view.ViewBean; 35 36 import java.util.EventObject ; 37 38 import javax.servlet.ServletRequest ; 39 40 41 44 public class NextPageHandler { 45 46 50 public void forwardTo(RequestContext ctx, HandlerContext handlerCtx) { 51 String nextPage = (String )handlerCtx.getInputValue(NEXT_PAGE); 52 if (nextPage == null) { 53 throw new IllegalArgumentException ("The attribute '"+NEXT_PAGE+ 54 "' must be set to the ID of the next page to display!"); 55 } 56 try { 57 ViewBean viewBean = ctx.getViewBeanManager().getViewBean(nextPage); 58 viewBean.forwardTo(ctx); 59 } catch (ClassNotFoundException ex) { 60 throw new FrameworkException( 61 "Unable to find the ViewBean specified by page id: " + 62 nextPage, ex); 63 } 64 } 65 66 72 public void markRequestComplete(RequestContext ctx, HandlerContext handlerCtx) { 73 throw new CompleteRequestException(); 74 } 75 76 77 78 82 83 86 public static final String NEXT_PAGE = "nextPage"; 87 } 88 | Popular Tags |