About how to word the question for tomcat-dev: "Hi, I'm interested in developing an 'in-process' feature if it's not already there, will start sending out patches " :-)
BTW - there is also an 'in-memory' connector in coyote, not sure what's his status - but it can be easily enhanced. You actually need 3 things: - launching tomcat in-process - there are few ways to do this ( easy if you can keep the dir layout, harder but possible if you don't ) - use a connector that doesn't open ports - some API to make it easier to communicate with the connector - basically populate the coyote request and pull the response. Costin On Mon, Oct 6, 2008 at 12:44 PM, Jess Holle <[EMAIL PROTECTED]> wrote: > Cool. > > Thanks for the helpful reply. > > I just wish I could have figured out how to word my question better so as > to elicit this helpful information to start with -- instead of getting told > I was posting to the wrong group and chasing my tail with it. > > -- > Jess Holle > > > Costin Manolache wrote: > >> Well, there is interest - the tomcat-lite in the sandbox does allow that ( >> there is even a TomcatLiteNoConnector unit test ). >> >> The code is broken right now - in process of moving part of it to trunk >> and >> adjusting it to be easier to digest. Will take quite a while >> before it's ready for an official release - but ability to run 'in >> process' >> ( either as unit tests, or as you describe ) is one of the goals. >> >> Costin >> >> On Mon, Oct 6, 2008 at 11:16 AM, Jess Holle <[EMAIL PROTECTED]> wrote: >> >> >>> Having looked into this further it seems clear Tomcat is not designed to >>> provide any reasonably reliable / easy-to-use means of making a JSP or >>> servlet request from within the process but outside a connector request >>> thread. If one wants to properly do this it would appear one has to call >>> org.apache.catalina.core.StandardEngineValve.invoke() oneself -- with >>> Tomcat >>> Request and Response objects. Ideally there would be a way to instead >>> implement HttpServletRequest and HttpServletResponse as desired, >>> mimicking >>> remote client to the degree needed, get a RequestDispatcher [from a >>> cached >>> ServletContext], and call forward(), for instance -- possibly capturing >>> the >>> context class loader in a ContextListener and setting that as the context >>> class loader around all this. That /kind of/ works for include(), but >>> skips >>> all servlet filters and does not work at all for forward(). >>> >>> I fully realize the servlet specification spells out no such mechanism, >>> but >>> I believe there is a clear gap here. One should be able to embed Tomcat >>> in >>> an application and /easily /invoke a JSP or servlet to produce an HTML >>> e-mail body, for instance. This should involve a minimum of >>> Tomcat-specific >>> APIs. >>> >>> It is hard to understand why one should be unable to re-use one's JSPs >>> and >>> servlet investment to produce HTML for other purposes than HTTP >>> responses.// >>> It is also quite unclear to me why there appears to be no interest in >>> addressing this need. >>> >>> -- >>> Jess Holle >>> >>> >>> Jess Holle wrote: >>> >>> >>>> I find no user documentation on anything like what I'm looking for. >>>> >>>> I thus am /assuming/ this would be an extension to Tomcat and thus more >>>> appropriate for a development forum than a user forum. >>>> >>>> I want to call JSPs, etc, from Java code to generate HTML. I'm not >>>> looking for a web server connector -- that would be a clear user group >>>> question. >>>> >>>> Remy Maucherat wrote >>>> >>>>> On Wed, 2008-09-17 at 07:48 -0500, Jess Holle wrote >>>>> >>>>>> Is there an in-process connector for Tomcat somewhere out there? >>>>>> >>>>>> Specifically I want to be able to embed Tomcat and use JSPs, etc, to >>>>>> generate HTML but without requiring loopback HTTP(S) requests. >>>>>> >>>>>> Does such a thing exist? If not, would this be hard to add? >>>>>> >>>>>> Pointers and suggestions would be much appreciated. >>>>>> >>>>>> >>>>> There is a user list for questions on Tomcat usage. >>>>> >>>>> Rémy >>>>> >>>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >