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 2011/11/23 22:21:24 UTC

DO NOT REPLY [Bug 52236] New: Idea: support 'overlays' shaped like Maven overlays

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

             Bug #: 52236
           Summary: Idea: support 'overlays' shaped like Maven overlays
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: bimargulies@gmail.com
    Classification: Unclassified


Created attachment 27978
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27978
some code to look at.

The attached code allows tomcat to merge in one or more partial webapps to
build up the definitive webapp.

I wrote this code to support a particular development/debugging methodology.

I have a launcher program that uses the embedded API to launch tomcat with a
webapp with the static materials sitting where they sit in my dev tree, and the
classpath for the webapp taking the classes where eclipse writes them as well.

The result is live debugging. I wanted to extend this to the case where some of
my static content was merged in from 'overlays' in the maven-war-plugin sense
of the term, and I came up with the attached.

You may think it's nuts. You may think that it points up some modularity issues
around the context classses; there are an awful lot of tests for instanceof and
casts in this neighborhood.

If you have some sympathy for this idea, I would be willing to refine it and/or
work on an associated patch to change the modularity around
DirContext/BaseDirContext/StandardContext to make it less ugly to create.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52236] Idea: support 'overlays' shaped like Maven overlays

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

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-11-23 21:44:48 UTC ---
Personally, I am of the view that this is a build time problem rather than one
that should be solved at runtime.

However, Oracle does not agree with me and it looks like something along these
lines will be required as part of the next version of the servlet spec. Until
the requirements are firmed up it is hard to know what the best implementation
approach will be. My preference will be for the simplest code that does the
least possible amount of work "on the fly".

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52236] Idea: support 'overlays' shaped like Maven overlays

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

--- Comment #3 from Mark Thomas <ma...@apache.org> 2011-11-23 22:07:25 UTC ---
I'm a big fan of re-factoring. One of the things on my todo for Tomcat 8 is to
at least look at removing all the JNDI stuff from DirContext JNDI stuff and
simplify all that code.

Anything that cleans-up and/or simplifies the code is welcome.

7.0.x is probably beyond the point where we want to make bug changes but we
have free reign in trunk.

Aliases are along a similar line to overlays (for static content). It may be
worth extending aliases / combining your ideas with the current code (he says
without having had a chance to look at your patch).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52236] Idea: support 'overlays' shaped like Maven overlays

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

--- Comment #5 from Sylvain Laurent <sl...@apache.org> 2011-11-24 21:56:45 UTC ---
I have been working on bug 51741 for some time now and will commit something in
a couple of days. I think it will be useful to you.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52236] Idea: support 'overlays' shaped like Maven overlays

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

--- Comment #2 from bmargulies <bi...@gmail.com> 2011-11-23 21:54:21 UTC ---
My experience is that I can get work done on webapps much, much, faster if I
operate in a mode where modified files are directly read by the web server. If
I have to run a build every time I want to see the results of a change, I'm
sad.

As far as build-time goes, that's all covered by the maven-war-plugin.

Further, you might call this just an alternative to the setResourceJar feature
that accepts multiple webapp-shaped dirs instead of one META-INF/resources.

However, I don't expect you all to buy a bridge from me.

Slightly tangentially, do you have any sympathy for my view that something like
this could easier with some sort of refactoring of the Context class family? I
feel somewhat presumptuous. It seems like I shouldn't have had to create a
wierd subclass of FileDirContext in addition to a subclass of StandardContext
-- Or maybe I should just done the MultiDirContext and passed that into
setResources of an ordinary StandardContext?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52236] Idea: support 'overlays' shaped like Maven overlays

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

--- Comment #4 from bmargulies <bi...@gmail.com> 2011-11-23 22:08:59 UTC ---
Aliases, if I have it right, say 'substitute in a tree of static content
*here*'. The patch says, 'first look in this webapp-shaped directory, then the
next, then the next, then finally the 'real' one. 

I'll have a look at trunk refactoring.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 52236] Idea: support 'overlays' shaped like Maven overlays

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

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

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

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
This was implemented in Tomcat 8 as part of the resources refactoring.

-- 
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