1 18 package org.apache.beehive.netui.pageflow.scoping.internal; 19 20 import javax.servlet.ServletConfig ; 21 import javax.servlet.ServletContext ; 22 import java.util.Enumeration ; 23 24 25 28 public class ScopedServletConfig 29 extends AttributeContainer 30 implements ServletConfig 31 { 32 private ServletContext _context; 33 private String _servletName; 34 35 public ScopedServletConfig( ServletContext context, ServletConfig baseServletConfig ) 36 { 37 _context = context; 38 39 for ( Enumeration e = baseServletConfig.getInitParameterNames(); e.hasMoreElements(); ) 40 { 41 String paramName = ( String ) e.nextElement(); 42 setAttribute( paramName, baseServletConfig.getInitParameter( paramName ) ); 43 } 44 45 _servletName = baseServletConfig.getServletName(); 46 } 47 48 public String getServletName() 49 { 50 return _servletName; 51 } 52 53 public ServletContext getServletContext() 54 { 55 return _context; 56 } 57 58 public String getInitParameter( String s ) 59 { 60 return ( String ) getAttribute( s ); 61 } 62 63 public Enumeration getInitParameterNames() 64 { 65 return getAttributeNames(); 66 } 67 } 68 | Popular Tags |