tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: [5] Two proposals.
Date Wed, 24 Mar 2004 16:03:48 GMT
Jeanfrancois Arcand wrote:
> Hi,
> 
> I would like to propose two modifications:
> 
> [1] XML Validation
> ----------------------------
> I would like to make two changes to the way xml validation is implemented:
> 
> (1) make the attribute available at the context level (turned off by 
> default)
> (2) add supports for turning on/off web.xml validation and tld 
> validation separately.
> 
> 
> The host implementation will stay the same (the current one). This way 
> it will be possible to turn on/off validation of TLDs without impacting 
> performance (e.g.web.xml)

Ah ok.

> [2] Overridable list of javax packages in WebappClassloader.
> -------------------------------------------------------------------------------- 
> 
> Right now, the WebappClassloader.packageTriggers contains "javax". I 
> guess this restriction comes from the J2EE specs, except that we should 
> allow users to override packages that start with javax but are *not* 
> included in J2EE (ex: JSF, JSTL). I would like to add a mechanism that 
> contains a list of overridable packages:
> 
>>     /**
>>      * Adds the given package name to the list of packages that may 
>> always be
>>      * overriden, regardless of whether they belong to a protected 
>> namespace
>>      */
>>     public void addOverridablePackage(String packageName){
>>         if (overridablePackages == null){
>>             overridablePackages = new ArrayList();
>>         }
>>         overridablePackages.add(packageName);
>>     }
> 
> 
> and add in WebappClassloader.filter(...)
> 
>>         if (overridablePackages != null){
>>             for (int i = 0; i < overridablePackages.size(); i++) {
>>                 if (packageName.
>>                         startsWith((String)overridablePackages.get(i)))
>>                     return false;
>>             }
>>         }
> 
> 
> 
> 
> and then either add an attribute in context.xml (or globally in 
> server.xml...I have no prefs). As an example, putting JSTL 1.0 under 
> common/lib and bundling JSTL 1.1 in WEB-INF/lib will possibly cause 
> problems, because the API starts with javax.servlet.jsp.jstl.*, and the 
> 1.0 api will get loaded instead of 1.1 (I know , API are not supposed to 
> changes, but the reality is different :-) )
> 
> Comments?

Well, the second one wouldn't change many things. packageTrigger is 
mostly useless right now, ever since I added "delegate first to the 
system classloader". Indeed, this would allow overriding specific stuff 
like JSTL.

Rémy


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


Mime
View raw message