You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(68) |
Dec
(77) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(75) |
Feb
(84) |
Mar
(89) |
Apr
(96) |
May
(52) |
Jun
(73) |
Jul
(99) |
Aug
(46) |
Sep
(40) |
Oct
(46) |
Nov
(45) |
Dec
(25) |
2004 |
Jan
(13) |
Feb
(74) |
Mar
(40) |
Apr
(18) |
May
(31) |
Jun
(1) |
Jul
(16) |
Aug
(1) |
Sep
(21) |
Oct
(19) |
Nov
(10) |
Dec
(16) |
2005 |
Jan
(4) |
Feb
(12) |
Mar
(46) |
Apr
(33) |
May
(64) |
Jun
(1) |
Jul
(60) |
Aug
(31) |
Sep
(26) |
Oct
(24) |
Nov
(37) |
Dec
(10) |
2006 |
Jan
(3) |
Feb
(31) |
Mar
(122) |
Apr
(22) |
May
(4) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(8) |
Nov
(3) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(8) |
From: Tim P. <tpp...@pa...> - 2004-12-01 14:08:29
|
Hi Keats and Lane, Thanks, I have changed http://melati.org/cgi-bin/cvsweb.cgi/melati/src/org/melati/template/Template Engine.java http://melati.org/cgibin/cvsweb.cgi/melati/src/org/melati/template/webmacro/ WebmacroTemplateEngine.java and http://melati.org/cgi-bin/cvsweb.cgi/melati/src/org/melati/servlet/TemplateS ervlet.java And have checked that I am using WM(HttpServlet) Jetty log: [java] Initialising with [java] 13:32:53.474 EVENT WebMacro:LogFile NOTICE --- Log Started --- [java] 13:32:53.474 EVENT WebMacro:broker NOTICE Loaded settings from Web Macro.defaults, WebMacro.properties, (WAR file), (System Properties) [java] 13:32:53.583 EVENT WebMacro:wm NOTICE new WebMacro(org.mortbay .jetty.servlet.ServletHandler$Context@2bc3f5) v2.0b1 but it still doesn't find templates in a jar file in the war. any clues? thanks tim |
From: Lane S. <la...@op...> - 2004-11-24 16:57:46
|
I could incorporate this into WMEval.java as a new constructor: WMEval(Object env) { if (env instanceof HttpServlet) wm = new WM(this); else wm = new WM(); } Tim: perhaps you could take a look at WMEval as that this may provide some guidelines. WMEval is a wrapper which encapsulates both Servlet and non-Servlet environments. -Lane Keats Kirsch wrote: > The Servlet container knows how to load things from the Servlet class > path, but POJOs don't know anything about this. The Servlet22Broker > basically delegates the search to the container. > Since WM can run outside of Servlet containers, we use a trick of > passing in the Servlet instance in the constructor to get determine > that it is in "Servlet-mode" and to get access to the ServletContext. > You could do something similar, like: > > if (this instanceof HttpServlet) wm = new WM(this); > else wm = new WM(); > > Hope this helps. > > Keats > > Tim Pizey wrote: > >> Hi Keats, >> Thanks for your patience, >> On Tuesday 23 November 2004 18:47, Keats Kirsch wrote: >> >> >>> I guess you can see the issue here. You want to use Servlet-specific >>> functionality without introducing Servlet-specific code. I suppose you >>> could create a new version of WM that allows you to set the broker >>> outside of the constructor, but at some point you'll have to provide a >>> reference to the context so that the broker knows where to look. >>> >> >> >> The default behaviour currently appears to be to look for templates >> in a sub-set of the classpath ? >> >> I only have a naive view of how the servlet container classpath works >> but I got the impression it was something like >> CLASSPATH = WEB-INF/classes; WEB-INF/lib/*.jar ; endorsed/*.jar ; >> inheritted classpath >> Is the above not available as a list of places to look, perhaps even >> in a handy CLASSPATH environment variable, without having to invoke a >> servlet specific broker? >> >> I guess what I don't understand is if a class can be found both in >> WEB-INF/classes and WEB-INF/lib/*.jar why can't a template? >> >> So I guess I can't see why this is servlet specific functionality? >> >> thanks again >> >> tim >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://productguide.itmanagersjournal.com/ >> _______________________________________________ >> Webmacro-user mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |
From: Keats K. <ke...@xa...> - 2004-11-24 15:02:17
|
The Servlet container knows how to load things from the Servlet class path, but POJOs don't know anything about this. The Servlet22Broker basically delegates the search to the container. Since WM can run outside of Servlet containers, we use a trick of passing in the Servlet instance in the constructor to get determine that it is in "Servlet-mode" and to get access to the ServletContext. You could do something similar, like: if (this instanceof HttpServlet) wm = new WM(this); else wm = new WM(); Hope this helps. Keats Tim Pizey wrote: >Hi Keats, > >Thanks for your patience, > >On Tuesday 23 November 2004 18:47, Keats Kirsch wrote: > > >>I guess you can see the issue here. You want to use Servlet-specific >>functionality without introducing Servlet-specific code. I suppose you >>could create a new version of WM that allows you to set the broker >>outside of the constructor, but at some point you'll have to provide a >>reference to the context so that the broker knows where to look. >> >> > >The default behaviour currently appears to be to look for >templates in a sub-set of the classpath ? > >I only have a naive view of how the servlet container classpath >works but I got the impression it was something like > >CLASSPATH = WEB-INF/classes; WEB-INF/lib/*.jar ; endorsed/*.jar ; inheritted >classpath > >Is the above not available as a list of places to look, >perhaps even in a handy CLASSPATH environment variable, >without having to invoke a servlet specific broker? > >I guess what I don't understand is if a class can be found both in >WEB-INF/classes and WEB-INF/lib/*.jar why can't a template? > >So I guess I can't see why this is servlet specific functionality? > >thanks again > >tim > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > |
From: Tim P. <ti...@pa...> - 2004-11-23 22:40:41
|
Hi Keats, Thanks for your patience, On Tuesday 23 November 2004 18:47, Keats Kirsch wrote: > I guess you can see the issue here. You want to use Servlet-specific > functionality without introducing Servlet-specific code. I suppose you > could create a new version of WM that allows you to set the broker > outside of the constructor, but at some point you'll have to provide a > reference to the context so that the broker knows where to look. The default behaviour currently appears to be to look for templates in a sub-set of the classpath ? I only have a naive view of how the servlet container classpath works but I got the impression it was something like CLASSPATH = WEB-INF/classes; WEB-INF/lib/*.jar ; endorsed/*.jar ; inheritted classpath Is the above not available as a list of places to look, perhaps even in a handy CLASSPATH environment variable, without having to invoke a servlet specific broker? I guess what I don't understand is if a class can be found both in WEB-INF/classes and WEB-INF/lib/*.jar why can't a template? So I guess I can't see why this is servlet specific functionality? thanks again tim |
From: Keats K. <ke...@xa...> - 2004-11-23 19:23:10
|
I had developed a way to use "context-aware" functions, but I think the concept was rejected in favor of the new AutoContextVariable concept. I believe it works something like: public class ContextManipulator implements ContextAutoLoader { public Object get(String name, Context context) throws PropertyException { return doSomethingWithTheContext(context); } } I think you configure this as a ContextTool, like: ContextTools.Manipulate: com.acme.wm.ContextManipulator And then access it in the template like: $Manipulate Hope this helps. Keats marcel.huijkman wrote: > How to get the context into a ContextTool? > > I am playing with a ContextTool, which does a lot for me, but I > want to be able to manipulate the context from within my too. > > I can do it in a dirty kind of way, by putting the context in > a var "WM_CONTEXT" into the context. > > And if I have to get of set something, I'll do it like this in my > template: > $util.manipulate($WM_CONTEXT); > > But I was wandering if there isn't any better, cleaner way to do this? > Can a ContextTool (that is loaded once) manipulate the exact context > the end-user is playing with? > > - Marcel - > > PS. I start working for a java-company next year, so I hope to do more > WM. > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Keats K. <ke...@xa...> - 2004-11-23 18:47:37
|
I guess you can see the issue here. You want to use Servlet-specific functionality without introducing Servlet-specific code. I suppose you could create a new version of WM that allows you to set the broker outside of the constructor, but at some point you'll have to provide a reference to the context so that the broker knows where to look. Keats Tim Pizey wrote: > >Hi Keats, Lane, >Thanks for bearing with me. > >Keats Kirsch wrote: > > >>My guess is that it has to do with which Broker you are >>using, which depends on how you instantiate WM. If you pass >>in a Servlet instance (JSDK 2.2+) it will instantiate the >>Servlet22Broker which should find the templates anywhere the >>Servlet class loader can find them. >> >> >> >WM is instantiated with wm = new WM () >see >http://www.melati.org/xref/org/melati/template/webmacro/WebmacroTemplateEngi >ne.html > > >I am not using a WebMacro.properties file. >In wiki the WebMacro.properties file does not change the defaults. > >I have checked out webmacro and wiki from cvs. >I see that I am not expected to be constructing >a WM without passing in a servlet, but Melati is able to >work outside of a servlet environment. > >Servlet22Broker is only mentioned once in WebMacro.defaults.classic > >How do I check what Broker I have got and change it if necessary? > >yours >tim > > > > |
From: marcel.huijkman <mar...@ra...> - 2004-11-23 14:33:13
|
How to get the context into a ContextTool? I am playing with a ContextTool, which does a lot for me, but I want to be able to manipulate the context from within my too. I can do it in a dirty kind of way, by putting the context in a var "WM_CONTEXT" into the context. And if I have to get of set something, I'll do it like this in my template: $util.manipulate($WM_CONTEXT); But I was wandering if there isn't any better, cleaner way to do this? Can a ContextTool (that is loaded once) manipulate the exact context the end-user is playing with? - Marcel - PS. I start working for a java-company next year, so I hope to do more WM. |
From: Tim P. <tpp...@pa...> - 2004-11-23 11:03:47
|
Hi Keats, Lane, Thanks for bearing with me. Keats Kirsch wrote: > > My guess is that it has to do with which Broker you are > using, which depends on how you instantiate WM. If you pass > in a Servlet instance (JSDK 2.2+) it will instantiate the > Servlet22Broker which should find the templates anywhere the > Servlet class loader can find them. > WM is instantiated with wm = new WM () see http://www.melati.org/xref/org/melati/template/webmacro/WebmacroTemplateEngi ne.html I am not using a WebMacro.properties file. In wiki the WebMacro.properties file does not change the defaults. I have checked out webmacro and wiki from cvs. I see that I am not expected to be constructing a WM without passing in a servlet, but Melati is able to work outside of a servlet environment. Servlet22Broker is only mentioned once in WebMacro.defaults.classic How do I check what Broker I have got and change it if necessary? yours tim |
From: Lane S. <la...@op...> - 2004-11-17 04:49:13
|
Templates are routinely accessed in a jar. In fact, if you look at the way the WM Wiki is built and instantiated at run time, all the templates are in a jar in the WEB-INF/lib folder. -Lane Keats Kirsch wrote: > My guess is that it has to do with which Broker you are using, which > depends on how you instantiate WM. If you pass in a Servlet instance > (JSDK 2.2+) it will instantiate the Servlet22Broker which should find > the templates anywhere the Servlet class loader can find them. > > Hope this helps. > > Keats > > Tim Pizey wrote: > >> Hi, >> Sorry, I am sure this is a FAQ, but have not been able to find the >> answer. >> I am building a war, using webmacro 2.0b1. >> >> I can access templates in the war file (ie in the WEB-INF/classes >> directory) but I cannot access templates in a jar in the lib directory. >> This seems to have been something which none of the Melati users have >> found a way around, so end up copying templates into each project. >> >> >> yours >> TimP >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: InterSystems CACHE >> FREE OODBMS DOWNLOAD - A multidimensional database that combines >> robust object and relational technologies, making it a perfect match >> for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >> _______________________________________________ >> Webmacro-user mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Keats K. <ke...@xa...> - 2004-11-17 02:31:57
|
My guess is that it has to do with which Broker you are using, which depends on how you instantiate WM. If you pass in a Servlet instance (JSDK 2.2+) it will instantiate the Servlet22Broker which should find the templates anywhere the Servlet class loader can find them. Hope this helps. Keats Tim Pizey wrote: >Hi, > >Sorry, I am sure this is a FAQ, >but have not been able to find the answer. > >I am building a war, using webmacro 2.0b1. > >I can access templates in the war file >(ie in the WEB-INF/classes directory) >but I cannot access templates in a jar >in the lib directory. > >This seems to have been something which >none of the Melati users have found a >way around, so end up copying templates into >each project. > > >yours >TimP > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > |
From: Tim P. <tpp...@pa...> - 2004-11-15 09:50:20
|
Hi, Sorry, I am sure this is a FAQ, but have not been able to find the answer. I am building a war, using webmacro 2.0b1. I can access templates in the war file (ie in the WEB-INF/classes directory) but I cannot access templates in a jar in the lib directory. This seems to have been something which none of the Melati users have found a way around, so end up copying templates into each project. yours TimP |
From: Lane S. <la...@op...> - 2004-10-04 22:48:22
|
good point, ebr. Can't we make CGI_Impersonator compatible with both using a little logic as is done with the Broker? -Lane Eric B.Ridge wrote: > On Oct 1, 2004, at 2:18 PM, Lane Sharman wrote: > >> great, >> >> I will make the change over the weekend. > > > Wait a minute... > >> Hai-Chen Tu wrote: >> <snip> > > >>> and add to the 2.0 release notes: >>> "WebMacro 2.0 requires Servlet 2.3 or newer." >> > > Then why do we need Servlet20Broker and Servlet22Broker if all of a > sudden we require jsdk 2.3? Also, I really think that making such a > compatibility change should be based on something more than a > seemingly unnecessary 1 line change to CGI_Impersonator... a class > which I doubt many people use. > > As Hai-Chen said, he can switch to using $Request, or he can write his > own CGI_Impersonator and configure it to be auto-loaded as a tool via > WebMacro.properties and we can continue to maintain backwards > compatibility to jsdk 2.0. > > eric > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: <Web...@St...> - 2004-10-03 17:54:38
|
On Sat, 2 Oct 2004, Eric B.Ridge wrote: | On Oct 1, 2004, at 2:18 PM, Lane Sharman wrote: | | > great, | > | > I will make the change over the weekend. | | Wait a minute... | | > Hai-Chen Tu wrote: | > <snip> | | >> and add to the 2.0 release notes: | >> "WebMacro 2.0 requires Servlet 2.3 or newer." | | Then why do we need Servlet20Broker and Servlet22Broker if all of a | sudden we require jsdk 2.3? Also, I really think that making such a | compatibility change should be based on something more than a seemingly | unnecessary 1 line change to CGI_Impersonator... a class which I doubt | many people use. I wholeheartedly agree. | | As Hai-Chen said, he can switch to using $Request, or he can write his | own CGI_Impersonator and configure it to be auto-loaded as a tool via | WebMacro.properties and we can continue to maintain backwards | compatibility to jsdk 2.0. Why not let it do some introspection or whatever, instead? Just check what options are available, and use the fastest? Then the release note could point out that "to use CGI.whatever, you have to be in an env having either A, B or C - in other cases, it'll return null.". Btw: I'd love to see a 2.0 pretty soon.. Endre |
From: Eric B. R. <eb...@tc...> - 2004-10-02 16:44:34
|
On Oct 1, 2004, at 2:18 PM, Lane Sharman wrote: > great, > > I will make the change over the weekend. Wait a minute... > Hai-Chen Tu wrote: > <snip> >> and add to the 2.0 release notes: >> "WebMacro 2.0 requires Servlet 2.3 or newer." Then why do we need Servlet20Broker and Servlet22Broker if all of a sudden we require jsdk 2.3? Also, I really think that making such a compatibility change should be based on something more than a seemingly unnecessary 1 line change to CGI_Impersonator... a class which I doubt many people use. As Hai-Chen said, he can switch to using $Request, or he can write his own CGI_Impersonator and configure it to be auto-loaded as a tool via WebMacro.properties and we can continue to maintain backwards compatibility to jsdk 2.0. eric |
From: Hai-Chen Tu <hc...@op...> - 2004-10-01 19:14:34
|
Lane, Thanks. Hai-Chen Tu At 02:18 PM 10/1/2004, Lane Sharman wrote: >great, > >I will make the change over the weekend. > >-Lane > >Hai-Chen Tu wrote: > >>Lane, >> I don't think I can check-out/check-in WebMacro CVS files. >> >> The change is to replace the line >> sc_ = ((ServletBroker) wc.getBroker()).getServletContext(); >> with >> >> sc_ = request_.getSession().getServletContext(); >> >> and add to the 2.0 release notes: >> "WebMacro 2.0 requires Servlet 2.3 or newer." >> >>Hai-Chen Tu |
From: Lane S. <la...@op...> - 2004-10-01 18:18:07
|
great, I will make the change over the weekend. -Lane Hai-Chen Tu wrote: > Lane, > I don't think I can check-out/check-in WebMacro CVS files. > > The change is to replace the line > sc_ = ((ServletBroker) > wc.getBroker()).getServletContext(); > with > > sc_ = request_.getSession().getServletContext(); > > and add to the 2.0 release notes: > "WebMacro 2.0 requires Servlet 2.3 or newer." > > Hai-Chen Tu > > At 01:37 PM 10/1/2004, Lane Sharman wrote: > >> Perfect. >> >> so do you know what to do with CGI_Impersonator now? >> >> -Lane >> >> Hai-Chen Tu wrote: >> >>> Lane, >>> >>> I searched Servlet JavaDoc and found out that one can use >>> request.getSession().getServletContext() to retrieve the >>> servlet context. >>> This getServletContext() method is available since Servlet 2.3. >>> >>> Hai-Chen Tu >> > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Chad A. <Cha...@da...> - 2004-10-01 18:03:50
|
unsubscribe |
From: Hai-Chen Tu <hc...@op...> - 2004-10-01 17:49:57
|
Lane, I don't think I can check-out/check-in WebMacro CVS files. The change is to replace the line sc_ = ((ServletBroker) wc.getBroker()).getServletContext(); with sc_ = request_.getSession().getServletContext(); and add to the 2.0 release notes: "WebMacro 2.0 requires Servlet 2.3 or newer." Hai-Chen Tu At 01:37 PM 10/1/2004, Lane Sharman wrote: >Perfect. > >so do you know what to do with CGI_Impersonator now? > >-Lane > >Hai-Chen Tu wrote: > >>Lane, >> >> I searched Servlet JavaDoc and found out that one can use >> request.getSession().getServletContext() to retrieve the servlet >> context. >> This getServletContext() method is available since Servlet 2.3. >> >>Hai-Chen Tu |
From: Sebastian K. <seb...@mu...> - 2004-10-01 17:40:34
|
Hai-Chen, Hai-Chen Tu wrote: > Without this problem, I think we can use a regular WM (i.e., not > initialized with a ServletBroker) as the base for WebMacro engine > in Spring. > And we can use WebContext inside WebMacroView for servlet > application and > regular Context for other usages (e.g., email templates). > right. We should come up with something to provide the handy WebMacro tools for people who want them to use and make it easy, to use WebMacro not only for the view layer, but also for other templating purposes. > Also, I think the main reasons for having > Servlet20Broker/Servlet22Broker are > to add few more places for locating property files, templates, and > other > resources and to use ServletContext.log(...) for logging purpose. > They probably > should be replaced by Spring-friendly ones, e.g., like the way > your have > implemented. yes, that's why I wrote a SpringBroker: to adapt to the Spring environment (that's what Broker's are for). Sebastian PS: Will be away until Tuesday |
From: Lane S. <la...@op...> - 2004-10-01 17:37:35
|
Perfect. so do you know what to do with CGI_Impersonator now? -Lane Hai-Chen Tu wrote: > Lane, > > I searched Servlet JavaDoc and found out that one can use > request.getSession().getServletContext() to retrieve the > servlet context. > This getServletContext() method is available since Servlet 2.3. > > Hai-Chen Tu > > At 01:22 PM 10/1/2004, Lane Sharman wrote: > >> Hai, >> >> I would deprecate the class or modify the class in support of the >> initiative and we will release 2.0 WM with this change as a release >> note. If you can modify CGIImpersonator and retain its functionality, >> do that. If not, we will deprecate the class entirely. >> >> -Lane >> >> Hai-Chen Tu wrote: >> >>> Lane, >>> I used $CGI for debugging purpose (dump form parameters) >>> but I can easily switch to $Request for the same result. >>> Hai-Chen >>> >>> At 12:49 PM 10/1/2004, Lane Sharman wrote: >>> >>>> cgi impersonator is not a mainline class and could be deprecated to >>>> support this initiative. >>>> >>>> -Lane >>>> >>>> Hai-Chen Tu wrote: >>>> >>>>> Sebastian, >>>>> I searched all the ContextTools code and found that >>>>> CGI_Impersonator is the only class that needs to >>>>> access ServletContext and it also assumes that >>>>> the broker is a ServletBroker (see code below). >>>>> >>>>> CGI_Impersonator(WebContext wc) { >>>>> requst_ = wc.getRequest(); >>>>> // this is not very nice, but I don't see any other >>>>> // possibility to get the servlet context. We >>>>> should >>>>> // provide a method in WebContext to hide this from >>>>> our users. >>>>> sc_ = ((ServletBroker) >>>>> wc.getBroker()).getServletContext(); >>>>> } >>>>> >>>>> Without this problem, I think we can use a regular WM (i.e., not >>>>> initialized with a ServletBroker) as the base for WebMacro >>>>> engine in Spring. >>>>> And we can use WebContext inside WebMacroView for servlet >>>>> application and >>>>> regular Context for other usages (e.g., email templates). >>>>> >>>>> Also, I think the main reasons for having >>>>> Servlet20Broker/Servlet22Broker are >>>>> to add few more places for locating property files, templates, >>>>> and other >>>>> resources and to use ServletContext.log(...) for logging >>>>> purpose. They probably >>>>> should be replaced by Spring-friendly ones, e.g., like the >>>>> way your have >>>>> implemented. >>>>> >>>>> So the question now is how to address the CGI issue. Comments? >>>>> Hai-Chen Tu >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.net email is sponsored by: IT Product Guide on >>>>> ITManagersJournal >>>>> Use IT products in your business? Tell us what you think of them. >>>>> Give us >>>>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >>>>> out more >>>>> http://productguide.itmanagersjournal.com/guidepromo.tmpl >>>>> _______________________________________________ >>>>> Webmacro-user mailing list >>>>> Web...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/webmacro-user >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.net email is sponsored by: IT Product Guide on >>>> ITManagersJournal >>>> Use IT products in your business? Tell us what you think of them. >>>> Give us >>>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >>>> out more >>>> http://productguide.itmanagersjournal.com/guidepromo.tmpl >>>> _______________________________________________ >>>> Webmacro-user mailing list >>>> Web...@li... >>>> https://lists.sourceforge.net/lists/listinfo/webmacro-user >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: IT Product Guide on >>> ITManagersJournal >>> Use IT products in your business? Tell us what you think of them. >>> Give us >>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >>> out more >>> http://productguide.itmanagersjournal.com/guidepromo.tmpl >>> _______________________________________________ >>> Webmacro-user mailing list >>> Web...@li... >>> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> > > > |
From: Lane S. <la...@op...> - 2004-10-01 17:36:41
|
Hi Sebastian, We are on the same page. If I elect to write an app within Spring, I want to use WM as a text view engine (and possibly some other things). Creating a web app is irrelevant. For example, I may be creating an email app or a payment gateway. -Lane Sebastian Kanthak wrote: > Hi Lane, > > thanks for your comments. > > I want to start with some comments as well to provide you with some > background information. First of all one has to decide what goals one > wants to achieve by "integrating" WebMacro and Spring. Integration > alone does not describe this exactly enough. I see two scenarios here: > > 1) Use the WebMacro "framework" (e.g. WMServlet) and access Spring > resources from there > 2) Use the Spring framework (not quoted because this is a real > framework :) ) and use WebMacro for the View layer > > For 1) you don't need any additional code, I think. You just fetch a > Spring (Web-)ApplicationContext during the initialisation of > WMServlet (or whatever approach you are using) and use it to get your > configured beans. > > I was interested in doing 2) that is use Spring's MVC framework and > WebMacro only as a template engine for the view. That means I want > everything else to be handled the Spring way: Logging, > Resource-Loading, request dispatching/handling etc... > > Lane Sharman wrote: > >> Couple of observations from experience. >> >> If you have read the new book, "Effective (or is it) Better Java", >> you will note that the author stresses the importance of decoupling >> dependencies. Therefore, I do not like either of the solutions below >> because you are subclassing WMServlet and WMBroker. What if they have >> side effects? Change? Are inadequate? WMBroker has a lot of >> implementation internals which could break a subclass. >> > I agree that the Spring integration should not be coupled with > WMServlet in any way. However I don't aggree with your points about > Broker. A Broker is WebMacro's way of adapting to an environment. As > Hai-Chen pointed out in another mail, it is mainly used for "external" > concerns like configuration, logging and resource loading. > > This is why I wrote my own SpringBroker: To make WebMacro use the > spring infrastructure. For example it uses Spring's preferred logging > system (common logs) that is usually configured through Spring. It > loads resources via Spring's resource loader, so that Spring users > don't have to learn WebMacro's template providers. > > Note that the users does not see SpringBroker at all, it is only an > implementation detail. All they see is a WM instance provided by > WMFactory bean, so they are not really coupled to anything, but the > standard WebMacro interface. > >> see: http://www.webmacro.org/api/org/webmacro/util/WMEval.html >> (the docs are a bit out of date). > > > > Can you elaborate on how such a class could fit into the Spring > framework? I don't see any use for it right now. > > Sebastian > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Hai-Chen Tu <hc...@op...> - 2004-10-01 17:33:39
|
Lane, I searched Servlet JavaDoc and found out that one can use request.getSession().getServletContext() to retrieve the servlet context. This getServletContext() method is available since Servlet 2.3. Hai-Chen Tu At 01:22 PM 10/1/2004, Lane Sharman wrote: >Hai, > >I would deprecate the class or modify the class in support of the >initiative and we will release 2.0 WM with this change as a release note. >If you can modify CGIImpersonator and retain its functionality, do that. >If not, we will deprecate the class entirely. > >-Lane > >Hai-Chen Tu wrote: > >>Lane, >> I used $CGI for debugging purpose (dump form parameters) >> but I can easily switch to $Request for the same result. >>Hai-Chen >> >>At 12:49 PM 10/1/2004, Lane Sharman wrote: >> >>>cgi impersonator is not a mainline class and could be deprecated to >>>support this initiative. >>> >>>-Lane >>> >>>Hai-Chen Tu wrote: >>> >>>>Sebastian, >>>> I searched all the ContextTools code and found that >>>> CGI_Impersonator is the only class that needs to >>>> access ServletContext and it also assumes that >>>> the broker is a ServletBroker (see code below). >>>> >>>> CGI_Impersonator(WebContext wc) { >>>> requst_ = wc.getRequest(); >>>> // this is not very nice, but I don't see any other >>>> // possibility to get the servlet context. We should >>>> // provide a method in WebContext to hide this from our users. >>>> sc_ = ((ServletBroker) >>>> wc.getBroker()).getServletContext(); >>>> } >>>> >>>> Without this problem, I think we can use a regular WM (i.e., not >>>> initialized with a ServletBroker) as the base for WebMacro engine >>>> in Spring. >>>> And we can use WebContext inside WebMacroView for servlet >>>> application and >>>> regular Context for other usages (e.g., email templates). >>>> >>>> Also, I think the main reasons for having >>>> Servlet20Broker/Servlet22Broker are >>>> to add few more places for locating property files, templates, and >>>> other >>>> resources and to use ServletContext.log(...) for logging purpose. >>>> They probably >>>> should be replaced by Spring-friendly ones, e.g., like the way >>>> your have >>>> implemented. >>>> >>>> So the question now is how to address the CGI issue. Comments? >>>>Hai-Chen Tu >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >>>>Use IT products in your business? Tell us what you think of them. Give us >>>>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >>>>http://productguide.itmanagersjournal.com/guidepromo.tmpl >>>>_______________________________________________ >>>>Webmacro-user mailing list >>>>Web...@li... >>>>https://lists.sourceforge.net/lists/listinfo/webmacro-user >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >>>Use IT products in your business? Tell us what you think of them. Give us >>>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >>>http://productguide.itmanagersjournal.com/guidepromo.tmpl >>>_______________________________________________ >>>Webmacro-user mailing list >>>Web...@li... >>>https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >>Use IT products in your business? Tell us what you think of them. Give us >>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >>http://productguide.itmanagersjournal.com/guidepromo.tmpl >>_______________________________________________ >>Webmacro-user mailing list >>Web...@li... >>https://lists.sourceforge.net/lists/listinfo/webmacro-user |
From: Lane S. <la...@op...> - 2004-10-01 17:28:44
|
> Without this problem, I think we can use a regular WM (i.e., not > initialized with a ServletBroker) as the base for WebMacro engine > in Spring. this statement above is really important. Any Spring integration must never be dependent on it running inside a servlet container. This is mandatory. thanks, Lane > |
From: Sebastian K. <seb...@mu...> - 2004-10-01 17:27:50
|
Hi Lane, thanks for your comments. I want to start with some comments as well to provide you with some background information. First of all one has to decide what goals one wants to achieve by "integrating" WebMacro and Spring. Integration alone does not describe this exactly enough. I see two scenarios here: 1) Use the WebMacro "framework" (e.g. WMServlet) and access Spring resources from there 2) Use the Spring framework (not quoted because this is a real framework :) ) and use WebMacro for the View layer For 1) you don't need any additional code, I think. You just fetch a Spring (Web-)ApplicationContext during the initialisation of WMServlet (or whatever approach you are using) and use it to get your configured beans. I was interested in doing 2) that is use Spring's MVC framework and WebMacro only as a template engine for the view. That means I want everything else to be handled the Spring way: Logging, Resource-Loading, request dispatching/handling etc... Lane Sharman wrote: > Couple of observations from experience. > > If you have read the new book, "Effective (or is it) Better Java", you > will note that the author stresses the importance of decoupling > dependencies. Therefore, I do not like either of the solutions below > because you are subclassing WMServlet and WMBroker. What if they have > side effects? Change? Are inadequate? WMBroker has a lot of > implementation internals which could break a subclass. > I agree that the Spring integration should not be coupled with WMServlet in any way. However I don't aggree with your points about Broker. A Broker is WebMacro's way of adapting to an environment. As Hai-Chen pointed out in another mail, it is mainly used for "external" concerns like configuration, logging and resource loading. This is why I wrote my own SpringBroker: To make WebMacro use the spring infrastructure. For example it uses Spring's preferred logging system (common logs) that is usually configured through Spring. It loads resources via Spring's resource loader, so that Spring users don't have to learn WebMacro's template providers. Note that the users does not see SpringBroker at all, it is only an implementation detail. All they see is a WM instance provided by WMFactory bean, so they are not really coupled to anything, but the standard WebMacro interface. > see: http://www.webmacro.org/api/org/webmacro/util/WMEval.html > (the docs are a bit out of date). Can you elaborate on how such a class could fit into the Spring framework? I don't see any use for it right now. Sebastian |
From: Lane S. <la...@op...> - 2004-10-01 17:22:24
|
Hai, I would deprecate the class or modify the class in support of the initiative and we will release 2.0 WM with this change as a release note. If you can modify CGIImpersonator and retain its functionality, do that. If not, we will deprecate the class entirely. -Lane Hai-Chen Tu wrote: > Lane, > I used $CGI for debugging purpose (dump form parameters) > but I can easily switch to $Request for the same result. > Hai-Chen > > At 12:49 PM 10/1/2004, Lane Sharman wrote: > >> cgi impersonator is not a mainline class and could be deprecated to >> support this initiative. >> >> -Lane >> >> Hai-Chen Tu wrote: >> >>> Sebastian, >>> I searched all the ContextTools code and found that >>> CGI_Impersonator is the only class that needs to >>> access ServletContext and it also assumes that >>> the broker is a ServletBroker (see code below). >>> >>> CGI_Impersonator(WebContext wc) { >>> requst_ = wc.getRequest(); >>> // this is not very nice, but I don't see any other >>> // possibility to get the servlet context. We should >>> // provide a method in WebContext to hide this from our >>> users. >>> sc_ = ((ServletBroker) >>> wc.getBroker()).getServletContext(); >>> } >>> >>> Without this problem, I think we can use a regular WM (i.e., not >>> initialized with a ServletBroker) as the base for WebMacro >>> engine in Spring. >>> And we can use WebContext inside WebMacroView for servlet >>> application and >>> regular Context for other usages (e.g., email templates). >>> >>> Also, I think the main reasons for having >>> Servlet20Broker/Servlet22Broker are >>> to add few more places for locating property files, templates, >>> and other >>> resources and to use ServletContext.log(...) for logging >>> purpose. They probably >>> should be replaced by Spring-friendly ones, e.g., like the way >>> your have >>> implemented. >>> >>> So the question now is how to address the CGI issue. Comments? >>> Hai-Chen Tu >>> >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: IT Product Guide on >>> ITManagersJournal >>> Use IT products in your business? Tell us what you think of them. >>> Give us >>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >>> out more >>> http://productguide.itmanagersjournal.com/guidepromo.tmpl >>> _______________________________________________ >>> Webmacro-user mailing list >>> Web...@li... >>> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >> Use IT products in your business? Tell us what you think of them. >> Give us >> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >> out more >> http://productguide.itmanagersjournal.com/guidepromo.tmpl >> _______________________________________________ >> Webmacro-user mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |