RE: Barracuda and using Servlet 2.3 features?
Kirk Daries <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <D09B591872D1D611AF2B0010B5A1AAD0527E4A@WCSMAIL> |
Hi, I'm all for the Servlet 2.3 spec. But as Christian pointed out... some containers aren't 2.3 compliant yet. I know one of my production servers is still 2.2. Now.. onto the topic at hand. I'm sure it's possible to make this configurable. I mean. After all. All we're trying to do, is dynamically load classes based on a config file(XML). All we need to do, is have a 2.3 'class Loader' and a 2.2 compliant 'class Loader'. We could then use reflection to instantiate the 'Loader' depending on some flag/param in the web.xml file. I know... allot of people don't like the word 'Reflection'... but I've used it exhaustively in my current application without any problems. If you really want to make things configurable, this is one of the best ways we can go for. Come to think of it. Aren't the Application Assembler and Event-gateways loaded using Reflection. If that is the case(I'm almost sure it is)... Adding a extra step won't hurt anyone. To get this working. All we need to do is define a common 'Loader' interface. Have the loaders extend a default loader( or implement the interface). At runtime... load the classes and cast to the Interface type. Call the relevant methods. This way. We can make both worlds happy. I for one have not deployed my application to a war file yet because I'm using the 'Multiple Application Assembler' option Jake touched on briefly. Regards KD -----Original Message----- From: Christian Cryder [mailto:[email protected]] Sent: 14 April 2003 09:58 To: [email protected] Subject: RE: [Barracuda] Barracuda and using Servlet 2.3 features? From my perspective, I'm all for a Servlet 2.3 dependency...since we're using Tomcat, it really isn't a big limitation for us. However...I have a feeling some folks here may be using servlet containers that don't support 2.3 yet, and if so, this would potentially affect them. If you fall into this category, please voice your opinions now so we can get an idea of how many are affected by this... Christian ---------------------------------------------- Christian Cryder [[email protected]] Internet Architect, ATMReports.com Barracuda - http://barracudamvc.org ---------------------------------------------- "Coffee? I could quit anytime, just not today" > -----Original Message----- > From: [email protected] > [mailto:[email protected]]On Behalf Of Jacob Kjome > Sent: Monday, April 14, 2003 3:25 PM > To: [email protected] > Subject: [Barracuda] Barracuda and using Servlet 2.3 features? > > > > Hi everyone, > > Just wondering how important Servlet 2.2 compatibility is for everyone > using Barracuda? > > I was considering modifying DefaultApplicationAssembler to use > getResourcePaths(String), which was added to the servlet api as > of servlet > 2.3, to load multiple event gateway xml files. The benefit of this would > be that one could specify a single event gateway xml file or a partial > pattern that all event gateway xml files to be loaded match and > this would > work both when deploying from a directory or from a .war file because no > File IO is involved. For instance, one could have... > > WEB-INF/ > event-gateway-bconfig.xml > event-gateway-myapp.xml > event-gateway-otherapp.xml > > Then in web.xml, you would have either.... > > <!-- Load only event gateway for myapp --> > <init-param> > <param-name>AssemblyDescriptor</param-name> > <param-value>/WEB-INF/event-gateway-myapp.xml</param-value> > </init-param> > > or... > > <!-- Load all event gateway xml files with the pattern > "event-gateway-" --> > <init-param> > <param-name>AssemblyDescriptor</param-name> > <param-value>/WEB-INF/event-gateway-</param-value> > </init-param> > > or even... > > <!-- Load all event gateway xml files in the "customconfig" directory --> > <init-param> > <param-name>AssemblyDescriptor</param-name> > <param-value>/WEB-INF/customconfig/</param-value> > </init-param> > > > The current way of loading multiple event gateway xml files uses File IO > and, therefore, is very sensitive to how the app is deployed. It must be > deployed as a directory or else things break. This is why File IO should > *never* be used within a web application, much less a framework for use > within web applications. Of course the current way benefits from > the fact > that it doesn't require support for servlet 2.3, only servlet 2.2. > > Anyway, let me know how ready you are to move to requiring Servlet 2.3. > > later, > > Jake > > _______________________________________________ > Barracuda mailing list > [email protected] > http://barracudamvc.org/lists/listinfo/barracuda _______________________________________________ Barracuda mailing list [email protected] http://barracudamvc.org/lists/listinfo/barracuda