You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/12/04 08:31:23 UTC

[Bug 54240] New: Configurable system level tagPlugins.xml

https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

            Bug ID: 54240
           Summary: Configurable system level tagPlugins.xml
           Product: Tomcat 7
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: xshao@ebay.com
    Classification: Unclassified

Created attachment 29687
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29687&action=edit
Patch for TagPluginManager.java

Currently, tagPlugins.xml can only be put in a WAR.
However, if the configuration can be put into a web framework, so web
application don't need to care about this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #10 from Sheldon Shao <xs...@ebay.com> ---
Hi Mark,

I made a little changes for Konstantin's concern. And refined the code and
uploaded the test case.

Please take a look.

Thanks,

Sheldon

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Comment on attachment 29687
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29687
Patch for TagPluginManager.java

No objections in principle. 

Some comments on the proposed solution:
1. I don't see a need for a system property here. Servlet context
initialization parameters are a better choice.
2. No documentation.
3. Patch doesn't follow Tomcat coding standards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
           Severity|normal                      |enhancement

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
For this implementation to work, one would need to put the configuration file
into classpath. I think that is not a good place for a configuration file.


If it were implemented via context initialization parameters or parameters of
JspServlet, I wonder how it will behave during offline generation of JSPs (aka
the jspc tool of Jasper). Some testing is needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #8 from Sheldon Shao <xs...@ebay.com> ---
Created attachment 29739
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29739&action=edit
A tag for testing

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #7 from Sheldon Shao <xs...@ebay.com> ---
Created attachment 29738
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29738&action=edit
A TagPlugin for testing

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #9 from Sheldon Shao <xs...@ebay.com> ---
Created attachment 29740
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29740&action=edit
Test case fo TagPluginManager

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

Sheldon Shao <xs...@ebay.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29687|0                           |1
           is patch|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #11 from Mark Thomas <ma...@apache.org> ---
I like the idea of using the existing mechanisms (such as
ServletContainerInitializer) but that would require other changes since:
- TagPluginManager is not created at the point where the SCI runs
- There is no mechanism to expose the TagPluginManager to the SCI

Given that changes would have to be made and that Tag plug-ins are a Tomcat
specific extension, I don't have an issue with a Tomcat specific mechanism to
configure these plug-ins. I like the META-INF/japser approach as it means a
plug-in JAR can be dropped into CATALINA_BASE/lib and be used by all web
applications on that instance.

I'll be working on applying this patch for 7.0.35.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #5 from Sheldon Shao <xs...@ebay.com> ---
Yes. Maybe it needs separated tagPlugins.xml for every tld file.

So the solution can be like this,
1. Check all resources in classpath with name "META-INF/jasper/tagPlugins.xml"
2. Parse them one by one and put all the tagPlugins into tagPluginManager.
3. Load tagPlugins configurations from "WEB-INF/tagPlugins.xml" if it existed.

With this new solution. TagPlugin declared in "META-INF/jasper/tagPlugins.xml"
can be override by WebApp.  Tag library provider can also provide its own
tagPlugins configurations for tag library.

What's your opinion ?

(In reply to comment #4)
> (In reply to comment #3)

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #3 from Sheldon Shao <xs...@ebay.com> ---
TagPlugin is good for making tag libraris more efficently. The target for tag
libraries is to share between multiple web applications. Same as TagPlugin.

Imagine that one enterprise has many web applications. It's better to share
same tagPlugins & tagPlugins.xml for all applications. So that all applications
can benifit from it. 

Currently the solution is putting the tagPlugins.xml under WEB-INF.
It is not good for shareing this tagPlugins.xml with other applications.

Now the solution still supports tagPlugins.xml under WEB-INF. Instead, it also
supports an system level tagPlugins.xml. This tagPlugins.xml might be packaged
with those implementations of TagPlugin.  

I think TagPlugin implementations must provide such kind of configuration file.
That's the idea of Zero-Configuration for web applications.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

Sheldon Shao <xs...@ebay.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29687|0                           |1
        is obsolete|                            |

--- Comment #6 from Sheldon Shao <xs...@ebay.com> ---
Created attachment 29737
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29737&action=edit
Patch for TagPluginManager.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> ---
(In reply to comment #3)

Your way goes to multiple tag libraries. If each one is self-contained, it
could configure itself, without a global tagPlugin file.

I do not know whether API is available in TagPluginManager, but there are
already hooks to plug libraries in a container:
a) support for a Listener in Tag Library Descriptor (TLD) file
b) ServletContainerInitializer in Servlet 3.0 specification

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54240] Configurable system level tagPlugins.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54240

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Mark Thomas <ma...@apache.org> ---
Thanks for the patch and test case.

This has been applied to trunk and 7.0.x and will be included in 7.0.35
onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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