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/06/22 17:54:00 UTC

DO NOT REPLY [Bug 51418] New: Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

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

             Bug #: 51418
           Summary: Allow more flexibility in adding webapps to
                    org.apache.catalina.startup.Tomcat
           Product: Tomcat 7
           Version: 7.0.16
          Platform: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: bimargulies@gmail.com
    Classification: Unclassified


Created attachment 27194
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27194
A patch to Tomcat.java as described.

the Tomcat.addWebapp all create a context, set up the default realm, and set up
the surrogate global web.xml lifecycle listener. They differ according to
allowing more or less specific configuration of the new webapp. At the end,
they add the new context to the host.

Once the container is running, the act of calling addChild starts it. Some
configuration steps have to precede 'start' -- for example, setting the loader.
Thus, in a complex case, the user needs to take more control of the process.

As things are today, this requires subclassing the Tomcat class and then
copying code from the four-arg addWebapp.

The patch provided here allows non-subclasses to take complete control of the
process. It accomplishes this by providing methods to obtain three things that
are otherwise buried in the Tomcat class: the default in-memory realm, the
listener that serves as a surrogate global web.xml, and a dummy pathname to
allow the listener to work without conflicts.

Given these accessors, a user can simple create a the context (and its
ContextConfig) and configure it to their heart's content, and then pass it to
the addChild method of a Host.

-- 
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 51418] Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         OS/Version|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-06-22 18:31:16 UTC ---
Thanks for the patch. It has been applied with a few changes (line lengths,
spaces rather than tabs) to 7.0.x and will be included in 7.0.17 onwards.

-- 
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 51418] Allow more flexibility in adding webapps to org.apache.catalina.startup.Tomcat

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

bmargulies <bi...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #27194|0                           |1
           is patch|                            |
  Attachment #27194|application/octet-stream    |text/plain
          mime type|                            |

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