[ 
http://nagoya.apache.org/jira/browse/BEEHIVE-121?page=comments#action_56198 ]
     
Kyle Marvin commented on BEEHIVE-121:
-------------------------------------

I'd probably phrase this enhancement request differently... but then maybe I'm 
asking for something different than Jonathan, so I'll let him respond if he 
thinks so:

I think what you really want is a contextual service that loads resources that 
are packaged in some container-specific way that the control should really not 
have to know or care about.   Rather than saying that this is 
ServletBeanContext exposing ServletContext.getResources more directly, it seems 
like it would be something like a contextual service that looks like:

public interface ResourceLoaderContext
{
     URL getResource(String path);
     InputStream getResourceAsStream(String path) 
}

The implementation of this contextual service _when run in the web tier_ would 
be to access the ServletContext and use the getResources API.   But for other 
containers is might mean something different.  For example in the EJB tier it 
might mean the resource is bundled into the EJB jar file and use the EJB 
classloader to access the resource.

A control that uses this service to load resources should not need to know the 
physical mechanism used to load resources;  but a developer using the control 
in a particular context would likely need to understand enough to put the 
resource files in the right place (in the webapp, or jarred w/ the ejb, etc).

> ServletBeanContext should expose ServletContext resources directly.
> -------------------------------------------------------------------
>
>          Key: BEEHIVE-121
>          URL: http://nagoya.apache.org/jira/browse/BEEHIVE-121
>      Project: Beehive
>         Type: Improvement
>   Components: Controls
>     Versions: V1Beta
>     Reporter: Jonathan Colwell
>     Assignee: Kenneth Tam
>     Priority: Minor

>
> ControlContainerContext should provide a getResource method that delegates to 
> parent containers until a Context that is able to provide resources is found. 
>  For example, the ServletBeanContext would expose the getResource method from 
> the ServletContext directly rather than requiring an individual control 
> implementation to know it runs in a servlet context and call
> getService(ServletContext.class, null);
> on an instance of ControlBeanContext to load a resource from the context.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to