jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: Proposal for tag library
Date Sat, 08 Nov 2003 18:25:18 GMT


Martin van Dijken wrote:
> It will be very hard I think to get this working in a transparent way or 
>  am I wrong there? 

Consider for instance the ServletContext.getResource() method here.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getResource(java.lang.String)

Ideally this method provides a very transparent means to traverse the 
hierarchy of a Webapplication whether it be in a War file or expanded 
onto the files system. I believe that most Servlet Containers implement 
this functionality using JNDI. Now this is very transparent, is it not?

But you also get another method in the ServletContext called 
getResourcePaths(...).

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getResourcePaths(java.lang.String)

Now we're getting somewhere, your able to get a set of "URL" paths 
relative to a specific point. Unfortunately the concept of a "directory" 
gets replaced more with the concept of a "context", but we know from 
JNDI there already is a very strong mapping between file systems and 
JNDI contexts.

 > Users would have to mount a file system in JNDI and
> the term JNDI alone is enough to make some people turn away.
> 

No, not necessarily, relative to the webapplication context, the user 
needs to know nothing about the fact that JNDI is being used. As well, 
internally to the taglibrary "mounting" of a JNDI Context could be a 
facilitated in such a way as to make it very transparent to the user as 
well. Imagine:

URL fileurl = application.getResource("/WEB-INF/lib/xyz.zip");

where ctx would be a jndi context configured by the library to be either 
a filesystem provider or a war/jar what have provider. I'm not sure if 
this is something actually exposed by the Container as a service.

Now, if I remember properly from the tutorial on JNDI Federated 
Namespacing. A JNDI lookup that returned this resource could configured 
to return an actual object or contents of that object, ie something 
similar to

URl url = (URL)ctx.lookup("/WEB-INF/lib/xyz.zip");

quite possibly this could span multiple naming contexts as so:

URl url = (URL)ctx.lookup("/WEB-INF/lib/xyz.zip/part1/abc/foo.txt");

a taglibrary built around this generic concept would basically be the 
jndi taglibrary, but jndi is an abstraction that scares people for some 
reason. And, when accessing a directory structure such as a "file 
system" they tend to use terms like "directory", "subdirectory", "path" 
and "file" instead of "Context", "Subcontext", "Name" and "Object". In 
the world of Webapplications there the added terminology of "resource" 
drawn from the Class.getResource(...) of object.

So, in the webapplication world, is there a generic way we can traverse 
this contextual space that's easy for the JSP taglibrary user to 
comprehend and map into their concept of "filesystem" but yet have it be 
generic enough to span the variations that can happen in the mounting of 
a Webapplication?

-Mark

> Martin
> 
> Mark R. Diggory wrote:
> 
>> What about soemthing more "generic" I.E. Jars and filesystems can be 
>> mounted as JNDI resources, we have a jndi taglibrary, maybe "flavors" 
>> of a JNDI taglibrary oriented towards Jar or Filesystem SP's? I 
>> understand much of the mechanism for mounting webapplications into 
>> tomcat relies on this?
>>
>> -M.
>>
>> Martin Cooper wrote:
>>
>>> On Fri, 7 Nov 2003, Martin van Dijken wrote:
>>>
>>>
>>>> Hey gang,
>>>>
>>>> Back on the list. Working out of home now, so I won't be responding
>>>> quickly since I have a dial-up at home. Apologies for that. That 
>>>> said, me
>>>> and a friend propose to add a taglibrary we've built to the jakarta
>>>> taglibs. We're not 100% sure what exactly is required to do so, so 
>>>> let me
>>>> give a description of what's been built.
>>>>
>>>> Simply put, the taglibrary displays information of the File system. It
>>>> allows the programmer to show directory structure, information from 
>>>> files,
>>>> folder listings etc. What we've been using it for is for creating 
>>>> dynamic
>>>> menus without using a database.
>>>>
>>>> What we'd like to know is:
>>>> - Is there interest for a taglib such as this?
>>>
>>>
>>>
>>>
>>> From me personally, no, since AFAIK a web app isn't guaranteed to have
>>> access to the file system (assuming there is one at all), so it doesn't
>>> seem like a good idea to build in such an assumption.
>>>
>>> But I'm sure there are folks who would use such a thing.
>>>
>>>
>>>> - What are the requirements on a taglib to be allowed into the 
>>>> jakarta cvs?
>>>
>>>
>>>
>>>
>>> See:
>>>
>>> http://jakarta.apache.org/taglibs/#GettingInvolved
>>>
>>> and in particular the section on New Project Submission.
>>>
>>> -- 
>>> Martin Cooper
>>>
>>>
>>>
>>>> Greetz,
>>>>
>>>> Martin van Dijken
>>>> Martin Reurings
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
>>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> 

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message