1 23 24 package com.sun.enterprise.tools.guiframework.view; 25 26 import com.iplanet.jato.CompleteRequestException; 27 import com.iplanet.jato.RequestContext; 28 import com.iplanet.jato.command.Command; 29 import com.iplanet.jato.command.CommandEvent; 30 import com.iplanet.jato.command.CommandException; 31 import com.iplanet.jato.command.CommandDescriptor; 32 import com.iplanet.jato.model.ModelControlException; 33 import com.iplanet.jato.model.ModelFieldBinding; 34 import com.iplanet.jato.model.ModelReference; 35 import com.iplanet.jato.view.BasicCommandField; 36 import com.iplanet.jato.view.CommandField; 37 import com.iplanet.jato.view.CommandFieldBase; 38 import com.iplanet.jato.view.CommandFieldDescriptor; 39 import com.iplanet.jato.view.View; 40 import com.iplanet.jato.view.ViewBean; 41 import com.iplanet.jato.view.ContainerView; 42 import com.iplanet.jato.view.ContainerViewBase; 43 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 44 import com.iplanet.jato.view.event.ChildDisplayEvent; 45 import com.iplanet.jato.view.event.DisplayEvent; 46 47 import com.sun.web.ui.model.wizard.WizardEvent; 48 49 import com.sun.enterprise.tools.guiframework.event.descriptors.EventDescriptor; 50 import com.sun.enterprise.tools.guiframework.event.descriptors.HandlerDescriptor; 51 import com.sun.enterprise.tools.guiframework.event.descriptors.UseHandlerDescriptor; 52 import com.sun.enterprise.tools.guiframework.exception.ChildNotRegisteredException; 53 import com.sun.enterprise.tools.guiframework.exception.FrameworkError; 54 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 55 import com.sun.enterprise.tools.guiframework.view.descriptors.DisplayFieldDescriptor; 56 import com.sun.enterprise.tools.guiframework.view.descriptors.FakeContainerDescriptor; 57 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 58 import com.sun.enterprise.tools.guiframework.view.event.AfterCreateEvent; 59 import com.sun.enterprise.tools.guiframework.view.event.BeforeCreateEvent; 60 import com.sun.enterprise.tools.guiframework.util.Util; 61 import com.sun.enterprise.tools.guiframework.util.LogUtil; 62 63 import java.io.File ; 64 import java.lang.reflect.InvocationTargetException ; 65 import java.lang.reflect.Method ; 66 import java.util.EventObject ; 67 import java.util.HashMap ; 68 import java.util.Iterator ; 69 import java.util.List ; 70 import java.util.Map ; 71 import java.util.Stack ; 72 73 import javax.servlet.ServletContext ; 74 75 76 79 public class DescriptorViewHelper { 80 81 85 public static void registerViewDescriptorChildren(ViewDescriptor viewDesc, ContainerViewBase container) { 86 try { 87 viewDesc.registerChildren(container); 88 } catch (CompleteRequestException ex) { 89 throw ex; 91 } catch (FrameworkException ex) { 92 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 94 } catch (Exception ex) { 95 throw new FrameworkError(ex, viewDesc, container); 96 } 97 } 98 99 100 103 public static View addCommandDescriptor(ContainerView container, View child, ViewDescriptor desc) { 104 if (!(child instanceof CommandField)) { 107 return child; 108 } 109 if (desc == null) { 110 if (LogUtil.isLoggable(LogUtil.INFO)) { 111 LogUtil.log(LogUtil.INFO, "framework.addCommandDescriptor", 112 child.getParent().getName()+"."+child.getName()); 113 } 114 return child; 115 } 116 117 while (container != null) { 119 if (container instanceof Command) { 120 break; 121 } 122 container = (ContainerView)container.getParent(); 123 } 124 if (container == null) { 125 throw new FrameworkException( 126 "The CommandField's container must implement Command in " + 127 "order to handle the CommandField!", desc, child); 128 } 129 130 Map map = new HashMap (1); 131 map.put(COMMAND_FIELD_DESCRIPTOR, desc); 132 CommandDescriptor commandDesc = new CommandDescriptor((Command)container, desc.getName(), map); 133 if (child instanceof BasicCommandField) { 134 ((BasicCommandField)child).setCommandDescriptor(commandDesc); 136 } else if (child instanceof CommandFieldBase) { 137 if (LogUtil.isLoggable(LogUtil.FINER)) { 139 LogUtil.log(LogUtil.FINER, "framework.oldCommandField", 140 child.getName()); 141 } 142 ((CommandFieldBase)child).setDescriptor( 143 new CommandFieldDescriptor(commandDesc)); 144 } else { 145 throw new FrameworkException("Unable to add CommandDescriptor " + 146 "to CommandField because it is not a 'BasicCommandField'" + 147 " or a 'CommandFieldBase'!", desc, child); 148 } 149 150 return child; 151 } 152 153 154 160 public static View createChild(DescriptorContainerView container, String name) { 161 if (LogUtil.isLoggable(LogUtil.FINEST)) { 163 LogUtil.log(LogUtil.FINEST, "trace.createChild", 164 container.getName()+"."+name); 165 } 166 167 RequestContext ctx = container.getRequestContext(); 169 170 ViewDescriptor containerDesc = container.getViewDescriptor(); 172 ViewDescriptor childDesc = containerDesc.getChildDescriptor(name); 173 174 ViewDescriptor fakeContDesc = null; 183 if (childDesc == null) { 184 List childDescriptors = 188 container.getViewDescriptor().getChildDescriptors(); 189 Iterator it = childDescriptors.iterator(); 190 while (it.hasNext()) { 191 fakeContDesc = (ViewDescriptor)it.next(); 192 if (fakeContDesc instanceof FakeContainerDescriptor) { 193 childDesc = fakeContDesc.getChildDescriptor(name); 194 if (childDesc != null) { 195 break; 196 } 197 } 198 } 199 } 200 204 if (childDesc == null) { 206 throw new ChildNotRegisteredException("Child '"+name+"' does not" + 207 " have a registered descriptor in '"+container.getName()+"'!", 208 container.getViewDescriptor(), container); 209 } 210 211 if (fakeContDesc != null) { 213 View tmp = container.getChild(fakeContDesc.getName()); 216 if (tmp instanceof ContainerView) { 220 return ((ContainerView)tmp).getChild(name); 224 } 225 } 226 227 ContainerView useContainer = container; 231 ViewDescriptor tmpDesc = childDesc.getParent(); 232 Stack stack = new Stack (); 233 while (tmpDesc != containerDesc) { 234 stack.push(tmpDesc.getName()); 235 tmpDesc = tmpDesc.getParent(); 236 } 237 View tmpView = null; 238 if (!stack.isEmpty()) { 239 while (!stack.isEmpty()) { 240 if (useContainer instanceof DescriptorContainerView) { 241 container = (DescriptorContainerView)useContainer; 243 } 244 tmpView = useContainer.getChild((String )stack.pop()); 245 if (tmpView instanceof ContainerView) { 246 useContainer = (ContainerView)tmpView; 248 } 249 } 250 251 if (useContainer != container) 256 return useContainer.getChild(childDesc.getName()); 257 } 258 259 DescriptorViewHelper.beforeCreate(ctx, 265 ((useContainer instanceof DescriptorContainerView) ? 266 (DescriptorContainerView)useContainer : container), childDesc); 267 268 View child = childDesc.getInstance(ctx, useContainer, name); 271 if (child == null) { 273 throw new ChildNullException(name, childDesc, useContainer); 274 } 275 276 addCommandDescriptor(useContainer, child, childDesc); 278 279 DescriptorViewHelper.afterCreate(ctx, child, childDesc); 287 288 return child; 289 } 290 291 292 306 public static void execute(RequestContext ctx, View view, CommandEvent event) throws CommandException { 307 Map params = event.getParameters(); 309 DisplayFieldDescriptor desc = (DisplayFieldDescriptor)params.get( 310 DescriptorViewHelper.COMMAND_FIELD_DESCRIPTOR); 311 try { 312 DescriptorViewHelper.dispatchEvent(ctx, view, desc, 314 desc.getEventDescriptor(EventDescriptor.TYPES.COMMAND), 315 (EventObject )event); 316 317 Object nextPage = desc.getParameter(NEXT_PAGE); 319 ViewBean viewbean = null; 320 if (nextPage != null) { 321 viewbean = 322 ctx.getViewBeanManager().getViewBean(nextPage.toString()); 323 } else { 324 viewbean = Util.getParentViewBean(view); 326 } 327 328 if (viewbean == null) { 330 throw new FrameworkException( 331 "Unable to display next page. '"+NEXT_PAGE+ 332 "' not found!", desc, view); 333 } 334 335 if (ctx.getRequestPhase() == ctx.SUBMIT_PHASE) { 338 viewbean.forwardTo(ctx); 339 } 340 341 DescriptorViewHelper.dispatchEvent(ctx, view, desc, 343 desc.getEventDescriptor(EventDescriptor.TYPES.AFTER_REQUEST), 344 (EventObject ) event); 345 } catch (CompleteRequestException ex) { 346 throw ex; 348 } catch (FrameworkException ex) { 349 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 351 } catch (Exception ex) { 352 throw new FrameworkError(ex, desc, (View)event.getSource()); 353 } 354 } 355 356 357 365 public static void beforeCreate(RequestContext ctx, DescriptorContainerView view, ViewDescriptor childDesc) { 366 try { 367 DescriptorViewHelper.dispatchEvent( 368 ctx, view, childDesc, 369 childDesc.getEventDescriptor( 370 EventDescriptor.TYPES.BEFORE_CREATE), 371 new BeforeCreateEvent(view, childDesc)); 372 } catch (CompleteRequestException ex) { 373 throw ex; 375 } catch (FrameworkException ex) { 376 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 378 } catch (Exception ex) { 379 throw new FrameworkError(ex, childDesc, view); 380 } 381 } 382 383 384 391 public static void afterCreate(RequestContext ctx, View view, ViewDescriptor childDesc) { 392 try { 393 DescriptorViewHelper.dispatchEvent( 394 ctx, view, childDesc, 395 childDesc.getEventDescriptor( 396 EventDescriptor.TYPES.AFTER_CREATE), 397 new AfterCreateEvent(view, childDesc)); 398 } catch (CompleteRequestException ex) { 399 throw ex; 401 } catch (FrameworkException ex) { 402 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 404 } catch (Exception ex) { 405 throw new FrameworkError(ex, childDesc, view); 406 } 407 } 408 409 410 414 418 public static void beginDisplay(DescriptorContainerView view, DisplayEvent event) throws ModelControlException { 419 if ((view.getParent() != null) && 420 (view.getParent() instanceof DescriptorContainerView)) { 421 return; 429 } 430 try { 431 ViewDescriptor vd = view.getViewDescriptor(); 433 DescriptorViewHelper.dispatchEvent( 434 view.getRequestContext(), 435 view, 436 vd, 437 vd.getEventDescriptor(EventDescriptor.TYPES.BEGIN_DISPLAY), 438 (EventObject )event); 439 } catch (CompleteRequestException ex) { 440 throw ex; 442 } catch (FrameworkException ex) { 443 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 445 } catch (Exception ex) { 446 throw new FrameworkError(ex, view.getViewDescriptor(), view); 447 } 448 } 449 450 451 454 public static boolean beginChildDisplay(DescriptorContainerView view, ChildDisplayEvent event) throws ModelControlException { 455 Object result = null; 456 457 String childName = event.getChildName(); 458 459 ViewDescriptor childDesc = 461 view.getViewDescriptor().getChildDescriptor(childName); 462 if (childDesc != null) { 463 View child = null; 466 try { 467 child = (childName == null) ? (view) : (view.getChild(childName)); 468 } catch (Exception ex) { 469 } 470 471 if (child == null) { 473 child = view; 474 } 475 476 try { 477 result = DescriptorViewHelper.dispatchEvent( 478 view.getRequestContext(), 479 child, 480 childDesc, 481 childDesc.getEventDescriptor( 482 EventDescriptor.TYPES.BEGIN_DISPLAY), 483 (EventObject )event); 484 } catch (CompleteRequestException ex) { 485 throw ex; 487 } catch (FrameworkException ex) { 488 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 490 } catch (Exception ex) { 491 throw new FrameworkError(ex, childDesc, child); 492 } 493 } 494 495 boolean retVal = true; 496 if (result instanceof Boolean ) { 497 retVal = ((Boolean )result).booleanValue(); 498 } 499 return retVal; 500 } 501 502 503 506 public static String endChildDisplay(DescriptorContainerView view, ChildContentDisplayEvent event) throws ModelControlException { 507 Object result = null; 508 509 String childName = event.getChildName(); 511 512 ViewDescriptor childDesc = 513 view.getViewDescriptor().getChildDescriptor(childName); 514 if (childDesc != null) { 515 View child = null; 518 try { 519 child = (childName == null) ? (view) : (view.getChild(childName)); 520 } catch (Exception ex) { 521 } 522 523 if (child == null) { 525 child = view; 526 } 527 528 try { 529 result = DescriptorViewHelper.dispatchEvent( 530 view.getRequestContext(), 531 child, 532 childDesc, 533 childDesc.getEventDescriptor( 534 EventDescriptor.TYPES.END_DISPLAY), 535 (EventObject )event); 536 } catch (CompleteRequestException ex) { 537 throw ex; 539 } catch (FrameworkException ex) { 540 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 542 } catch (Exception ex) { 543 throw new FrameworkError(ex, childDesc, child); 544 } 545 } 546 return (result == null) ? event.getContent() : result.toString(); 547 } 548 549 550 553 public static void endDisplay(DescriptorContainerView view, DisplayEvent event) { 554 if ((view.getParent() != null) && 555 (view.getParent() instanceof DescriptorContainerView)) { 556 return; 559 } 560 try { 561 ViewDescriptor vd = view.getViewDescriptor(); 562 DescriptorViewHelper.dispatchEvent( 563 view.getRequestContext(), 564 view, 565 vd, 566 vd.getEventDescriptor(EventDescriptor.TYPES.END_DISPLAY), 567 (EventObject )event); 568 } catch (CompleteRequestException ex) { 569 throw ex; 571 } catch (FrameworkException ex) { 572 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 574 } catch (Exception ex) { 575 throw new FrameworkError(ex, view.getViewDescriptor(), view); 576 } 577 } 578 579 580 583 public static boolean endWizard(ViewDescriptor viewDesc, WizardEvent event) throws ModelControlException { 584 Object result = null; 585 try { 586 result = DescriptorViewHelper.dispatchEvent( 588 event.getRequestContext(), 589 null, 590 viewDesc, 591 viewDesc.getEventDescriptor(EventDescriptor.TYPES.END_WIZARD), 592 new EventObject (event)); 593 } catch (CompleteRequestException ex) { 594 throw ex; 596 } catch (FrameworkException ex) { 597 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 599 } catch (Exception ex) { 600 throw new FrameworkError(ex, viewDesc, null); 601 } 602 603 boolean retVal = true; 604 if (result instanceof Boolean ) { 605 retVal = ((Boolean )result).booleanValue(); 606 } 607 return retVal; 608 } 609 610 611 614 public static boolean nextWizardStep(DescriptorContainerView view, WizardEvent event) throws ModelControlException { 615 Object result = null; 616 try { 617 ViewDescriptor vd = view.getViewDescriptor(); 618 result = DescriptorViewHelper.dispatchEvent( 619 view.getRequestContext(), 620 view, 621 vd, 622 vd.getEventDescriptor(EventDescriptor.TYPES.NEXT_WIZARD_STEP), 623 new EventObject (event)); 624 } catch (CompleteRequestException ex) { 625 throw ex; 627 } catch (FrameworkException ex) { 628 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 630 } catch (Exception ex) { 631 throw new FrameworkError(ex, view.getViewDescriptor(), view); 632 } 633 boolean retVal = true; 634 if (result instanceof Boolean ) { 635 retVal = ((Boolean )result).booleanValue(); 636 } 637 return retVal; 638 } 639 640 641 644 public static boolean prevWizardStep(DescriptorContainerView view, WizardEvent event) throws ModelControlException { 645 Object result = null; 646 try { 647 ViewDescriptor vd = view.getViewDescriptor(); 648 result = DescriptorViewHelper.dispatchEvent( 649 view.getRequestContext(), 650 view, 651 vd, 652 vd.getEventDescriptor(EventDescriptor.TYPES.PREV_WIZARD_STEP), 653 new EventObject (event)); 654 } catch (CompleteRequestException ex) { 655 throw ex; 657 } catch (FrameworkException ex) { 658 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 660 } catch (Exception ex) { 661 throw new FrameworkError(ex, view.getViewDescriptor(), view); 662 } 663 boolean retVal = true; 664 if (result instanceof Boolean ) { 665 retVal = ((Boolean )result).booleanValue(); 666 } 667 return retVal; 668 } 669 670 671 674 public static boolean goToWizardStep(DescriptorContainerView view, WizardEvent event) throws ModelControlException { 675 Object result = null; 676 try { 677 ViewDescriptor vd = view.getViewDescriptor(); 678 result = DescriptorViewHelper.dispatchEvent( 679 view.getRequestContext(), 680 view, 681 vd, 682 vd.getEventDescriptor(EventDescriptor.TYPES.GOTO_WIZARD_STEP), 683 new EventObject (event)); 684 } catch (CompleteRequestException ex) { 685 throw ex; 687 } catch (FrameworkException ex) { 688 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 690 } catch (Exception ex) { 691 throw new FrameworkError(ex, view.getViewDescriptor(), view); 692 } 693 boolean retVal = true; 694 if (result instanceof Boolean ) { 695 retVal = ((Boolean )result).booleanValue(); 696 } 697 return retVal; 698 } 699 700 701 704 public static boolean finishWizardStep(DescriptorContainerView view, WizardEvent event) throws ModelControlException { 705 Object result = null; 706 try { 707 ViewDescriptor vd = view.getViewDescriptor(); 708 result = DescriptorViewHelper.dispatchEvent( 709 view.getRequestContext(), 710 view, 711 vd, 712 vd.getEventDescriptor(EventDescriptor.TYPES.FINISH_WIZARD_STEP), 713 new EventObject (event)); 714 } catch (CompleteRequestException ex) { 715 throw ex; 717 } catch (Exception ex) { 718 throw new FrameworkException(ex, view.getViewDescriptor(), view); 719 } 720 boolean retVal = true; 721 if (result instanceof Boolean ) { 722 retVal = ((Boolean )result).booleanValue(); 723 } 724 return retVal; 725 } 726 727 728 731 public static boolean cancelWizardStep(DescriptorContainerView view, WizardEvent event) throws ModelControlException { 732 Object result = null; 733 try { 734 ViewDescriptor vd = view.getViewDescriptor(); 735 result = DescriptorViewHelper.dispatchEvent( 736 view.getRequestContext(), 737 view, 738 vd, 739 vd.getEventDescriptor(EventDescriptor.TYPES.CANCEL_WIZARD_STEP), 740 new EventObject (event)); 741 } catch (CompleteRequestException ex) { 742 throw ex; 744 } catch (FrameworkException ex) { 745 throw new FrameworkError(ex, ex.getResponsibleViewDescriptor(), ex.getResponsibleView()); 747 } catch (Exception ex) { 748 throw new FrameworkError(ex, view.getViewDescriptor(), view); 749 } 750 boolean retVal = true; 751 if (result instanceof Boolean ) { 752 retVal = ((Boolean )result).booleanValue(); 753 } 754 return retVal; 755 } 756 757 758 808 809 810 832 public static Object dispatchEvent(RequestContext reqCtx, View view, ViewDescriptor vd, EventDescriptor eventDesc, EventObject event) { 833 Object result = null; 834 835 if (eventDesc == null) { 837 return result; 838 } 839 try { 840 result = invokeHandlers(reqCtx, view, vd, event, eventDesc.getEventHandlers()); 842 } catch (Exception ex) { 843 if (ex instanceof java.lang.reflect.InvocationTargetException ) { 844 Throwable root = ex.getCause(); 848 if (root instanceof CompleteRequestException) { 849 throw (CompleteRequestException) root; 850 } 851 } 852 throw new FrameworkException( 853 ex.getClass().getName() + " while attempting to " + 854 "process a '" + eventDesc.getType() + "' event for '" + 855 eventDesc.getParent().getName() + "'.", 856 ex, eventDesc.getParent(), view); 857 } 858 859 return result; 861 } 862 863 864 867 private static Object invokeHandlers(RequestContext ctx, View view, ViewDescriptor vd, EventObject event, List useHandlerDescs) throws InstantiationException , IllegalAccessException , InvocationTargetException { 868 Object result = null; 869 Object retVal = null; 870 871 Iterator it = useHandlerDescs.iterator(); 872 UseHandlerDescriptor handler = null; 873 while (it.hasNext()) { 874 handler = (UseHandlerDescriptor)it.next(); 875 retVal = invokeHandler(ctx, handler, view, vd, event); 876 if (retVal != null) { 877 result = retVal; 878 } 879 } 880 881 return result; 882 } 883 884 885 889 protected static HandlerContext createHandlerContext(UseHandlerDescriptor useHandler, HandlerDescriptor handler, View view, ViewDescriptor vd, EventObject event) { 890 return new HandlerContextImpl(useHandler, handler, view, vd, event); 891 } 892 893 894 897 protected static Object invokeHandler(RequestContext ctx, UseHandlerDescriptor handler, 898 View view, ViewDescriptor vd, EventObject event) 899 throws InstantiationException , IllegalAccessException , InvocationTargetException { 900 901 HandlerDescriptor handlerDef = handler.getHandlerDescriptor(); 902 Method method = handlerDef.getHandlerMethod(); 903 904 Object retVal = null; 905 Object result = null; 906 907 if (LogUtil.isLoggable(LogUtil.FINER)) { 909 LogUtil.log(LogUtil.FINER, "trace.invoke", handlerDef.getName()); 910 } 911 912 if (handler.hasPermission(vd) && handlerDef.hasPermission(vd)) { 914 result = invokeHandlers( 916 ctx, view, vd, event, handlerDef.getChildHandlerDescriptors()); 917 918 HandlerContext handlerCtx = createHandlerContext(handler, handlerDef, view, vd, event); 920 921 if (method != null) { 924 929 Object instance = method.getDeclaringClass().newInstance(); 931 932 if (LogUtil.isLoggable(LogUtil.FINER)) { 934 LogUtil.log(LogUtil.FINER, "trace.invoke", 935 instance.getClass().getName()+"."+method.getName()); 936 } 937 938 retVal = method.invoke(instance, new Object [] {ctx, handlerCtx}); 939 if (retVal != null) { 940 result = retVal; 941 } 942 } 943 } else if (LogUtil.isLoggable(LogUtil.FINER)) { 944 String ifName = (vd.getParent() == null) ? 946 ("") : (vd.getParent().getName()+"."); 947 ifName += vd.getName()+"."+handlerDef.getName(); 948 LogUtil.log(LogUtil.FINER, "trace.ifFailed", ifName); 949 } 950 951 return result; 953 } 954 955 956 959 protected static void verifyClassExists(ServletContext sc, String fileName) throws ClassNotFoundException { 960 String className = null; 961 if (fileName.endsWith(".jsp")) { 962 className = fileName.substring(0,fileName.lastIndexOf(".jsp")) + "_jsp"; 963 className = className.replaceAll("/", "._"); 964 className = "_jasper" + className; 965 966 try { 967 Class clazz = Class.forName(className); 968 return; 969 } catch (ClassNotFoundException ex) { 970 } catch (Exception ex) { 971 } 972 } 973 if (sc != null) { 974 String path = sc.getRealPath(fileName); 976 File f = new File (path); 977 if (f.exists() == false) { 978 if (LogUtil.isLoggable(LogUtil.FINE)) { 979 if (className != null) { 980 LogUtil.log(LogUtil.FINE, "framework.classNotFound", 981 className); 982 } else { 983 LogUtil.log(LogUtil.FINE, "framework.fileNotFound", 984 path); 985 } 986 } 987 throw new ClassNotFoundException ((className == null) ? path : className); 988 } 989 } else { 990 throw new RuntimeException ("ServletContext is null!"); 991 } 992 } 993 994 995 998 public static final String NEXT_PAGE = "nextPage"; 999 1000 1001 1004 public static final String COMMAND_FIELD_DESCRIPTOR = "CommandField"; 1005} 1006 | Popular Tags |