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: Brian G. <br...@qu...> - 2004-03-01 23:24:37
|
>I am sure I am getting this wrong but: > >The FastWriter API only had one output object to deal with: a Writer, >so could be used to render to the output stream or to strings. The FastWriter actually had several (poorly documented!) ways of doing things. You could attach a FastWriter to an OUTPUT STREAM, in which case it would act like a writer but do its own bytes-to-chars thing using the encoding cache, OR, you could not bind it to a stream, and instead call .toString() to get the result as a String. >You have now chosen to treat Strings differently to the Response, as >StringWriters do not have a getOutputStream method. You now have the same two choices directly from Template: - write the results to an OUTPUT STREAM (template.write(outputStream, c)) - write the results to a STRING (template.evaluateAsString(c)) Simple! -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Tim P. <ti...@pa...> - 2004-03-01 23:07:53
|
On Monday 01 March 2004 8:26 pm, Tim Pizey wrote: > On Monday 01 March 2004 4:30 pm, Keats wrote: > > Generally you should be able to replace reference to FastWriter with > > references to the underlying OutputStream. I am sure I am getting this wrong but: The FastWriter API only had one output object to deal with: a Writer,=20 so could be used to render to the output stream or to strings. You have now chosen to treat Strings differently to the Response, as=20 StringWriters do not have a getOutputStream method.=20 I am in a horrible position, as I know I am bound to be wrong and=20 so do not want to be assertive. yours Tim Pizey |
From: Brian G. <br...@qu...> - 2004-03-01 22:35:12
|
>As far as I can see you have broken WebMacro at >a time when the userbase is very small. This is a bogus argument -- it becomes increasingly harder to undo bad decisions as the user base gets larger. >You have not 'removed the shit' you have changed the API and >broken everything. The FastWriter abstraction was a totally broken abstraction which should never have been exposed as part of the interface, being neither faster nor useful. The new interface does everything you could do with FastWriter before, but in terms of template functionality, not stream internals. A number of other broken optimizations were removed, such as all the attempts at manual garbage collection (requiring every object to be explicitly 'destroy'ed) and pooling which probably would have hurt performance, not helped it. Sorry you are frustrated -- perhaps more doc is needed -- but overall this seems a huge improvement. -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Brian G. <br...@qu...> - 2004-03-01 22:35:11
|
>I'd suggest just sticking with the output stream. Eg, change: > > String o = template.evaluateAsString(wc); > wc.getResponse().getWriter().write(o); > >to > > template.write(wc.Response().getOutputStream(), wc); This is exactly the intended means of using templates in servlets. No FastWriter. You might want to use this method, though, to preserve encouding: > template.write(wc.Response().getOutputStream(), > wc.Response().getOutputEncoding(), wc); -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Tim P. <ti...@pa...> - 2004-03-01 20:41:21
|
On Monday 01 March 2004 4:30 pm, Keats wrote: > From: "Tim Pizey" <ti...@pa...> > > > In particular the removal of the > > org.webmacro.Template(FastWriter, WebContext) method > > has me at a loss. > > Sorry you're having such trouble. Believe it or not, the FastWriter > changes were an attempt to simplify things. It just seemed like an ext= ra > level of complexity that could be complete hidden from the users.=20 > Generally you should be able to replace reference to FastWriter with > references to the underlying OutputStream. I think the problem is about ordering. Magically Melati was able to write to the underlying output stream at the= =20 right moment.=20 I cannot understand how that used to work.=20 > IMHO, the problem appears to be that Metali is too tightly coupled to t= he > internals of WebMacro. =20 I agree, and said so at the time, but understanding and writing this code= =20 (and the Velocity and JTemplater code) was TimJ 'at the top of his game'=20 it was the best and most difficult coding he had done.=20 Undoing it appears to be beyond me. > I'd suggest keeping it simple and just use trivial > adapters around the WebMacro API. > > I'm happy to try and help any way I can. I have a feeling that I am making a mountain out of a molehill,=20 and after this many years I get a bit upset with myself that I can't=20 'just do it' . I don't know what your setup is, but Melati is meant to be=20 easy to download, compile and run. Currently if you download from CVS,=20 cd build ant go http://localhost:8080/ You will find that the example works but that=20 the inner templets are rendered to the output stream before the=20 main template is rendered. > > Is there any interest in Freezing the 1.1 API and maintaining that? > > This is a good idea, but probably not realistic for us. We can at leas= t > keep the source available and post any usefull patches that come along. > > > (To be honest the last version that worked for me was 0.98) > > Any particular bugs in 1.1 that we can help with? I'm not aware of any > serious outstanding bugs. No 'bugs', but the white space eating behaviour was changed,=20 correctly I can see for non HTML rendering applications,=20 but my templates no longer produce the pretty HTML they used to. I am sure that there are improvements and features that have been=20 added since that time, but as far as I know I have no need of any of them= =2E > > The 2.0 API appears to have lost vital elements of the API and gained > > a raft of stuff that shouldn't be in a template engine, > > moving more and more towards a framework. > > Please be specific, so we can decide if your critiques have merit. > > Actually one of the objectives of the new release was to provide a mini= mal > configuration for folks who don't want "a raft of stuff". Most of the > changes have been to streamline and simplify the code. Yeah, I know, sorry, just been wasting precious time for nearly a week=20 now without doing paying work.=20 > > Good luck. Thanks Tim > > Keats > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user |
From: Keats <ke...@xa...> - 2004-03-01 16:43:14
|
----- Original Message ----- From: "Tim Pizey" <ti...@pa...> Subject: Re: [WebMacro-user] ANNOUNCE: WebMacro 2.0b1 has been released > In particular the removal of the > org.webmacro.Template(FastWriter, WebContext) method > has me at a loss. Sorry you're having such trouble. Believe it or not, the FastWriter changes were an attempt to simplify things. It just seemed like an extra level of complexity that could be complete hidden from the users. Generally you should be able to replace reference to FastWriter with references to the underlying OutputStream. IMHO, the problem appears to be that Metali is too tightly coupled to the internals of WebMacro. I'd suggest keeping it simple and just use trivial adapters around the WebMacro API. I'm happy to try and help any way I can. > Is there any interest in Freezing the 1.1 API and maintaining that? This is a good idea, but probably not realistic for us. We can at least keep the source available and post any usefull patches that come along. > (To be honest the last version that worked for me was 0.98) Any particular bugs in 1.1 that we can help with? I'm not aware of any serious outstanding bugs. > The 2.0 API appears to have lost vital elements of the API and gained > a raft of stuff that shouldn't be in a template engine, > moving more and more towards a framework. Please be specific, so we can decide if your critiques have merit. Actually one of the objectives of the new release was to provide a minimal configuration for folks who don't want "a raft of stuff". Most of the changes have been to streamline and simplify the code. Good luck. Keats |
From: Keats <ke...@xa...> - 2004-03-01 16:28:30
|
Tim, Without the StackTrace I have to guess ... I'm guessing the exception is happening when you call getWriter() on the response. The JavaDocs for this method say: IllegalStateException if the getOutputStream method has already been called for this response object So I'm guessing that you've already called getOutputStream somewhere. I'd suggest just sticking with the output stream. Eg, change: String o = template.evaluateAsString(wc); wc.getResponse().getWriter().write(o); to template.write(wc.Response().getOutputStream(), wc); Hope this helps. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Friday, February 27, 2004 8:21 PM Subject: Re: [WebMacro-user] Problems upgrading Melati to WebMacro 2.0b1 On Friday 27 February 2004 11:05 pm, Brian Goetz wrote: > >The problem seems to be that org.webmacro.Template no longer > >renders to a FastWriter but to an OutputStream, which breaks > >my rendering to a string buffer, as a StringWriter does not have > >an OutputStream ???? > > Template can also render directly to a String. I am getting IllegalStateException from the following public class WebmacroTemplate implements Template { private org.webmacro.Template template; public WebmacroTemplate(org.webmacro.Template t) { template = t; } /** * @param out A {@link MelatiWebmacroWriter}. */ public void write(MelatiWriter out, TemplateContext templateContext, TemplateEngine engine) throws TemplateEngineException { try { WebContext wc = (WebContext)templateContext.getContext(); if (out instanceof MelatiStringWriter) { String o = template.evaluateAsString(wc); wc.getResponse().getWriter().write(o); } else { OutputStream o = ((MelatiWebmacroWriter)out).getOutputStream(); template.write(o, wc); } } catch (ContextException e) { throw new TemplateEngineException(e); } catch (IOException e) { throw new TemplateEngineException(e); } } } going to bed, my eyes hurt Tim Pizey ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Webmacro-user mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-user |
From: Tim P. <ti...@pa...> - 2004-03-01 15:31:50
|
Hi all,=20 Please excuse the rant,=20 I have tried to get with the programme,=20 but I fail to understand what you have done or=20 why.=20 As far as I can see you have broken WebMacro at=20 a time when the userbase is very small.=20 You have not 'removed the shit' you have changed the API and=20 broken everything. Who do you think is prepared to keep up with these changes? Oh, I know, the committers. It looks as though this will be the spur for me to abandon WM. In particular the removal of the=20 org.webmacro.Template(FastWriter, WebContext) method=20 has me at a loss. Is there any interest in Freezing the 1.1 API and maintaining that? (To be honest the last version that worked for me was 0.98) The 2.0 API appears to have lost vital elements of the API and gained=20 a raft of stuff that shouldn't be in a template engine,=20 moving more and more towards a framework.=20 I have now got to figure out what to do. I have broken Melati and committed the broken code. So it is work to back out and work to plough on.=20 yours tim Pizey Not shaking my fist but drowning |
From: Tim P. <ti...@pa...> - 2004-02-28 01:34:43
|
On Friday 27 February 2004 11:05 pm, Brian Goetz wrote: > >The problem seems to be that org.webmacro.Template no longer > >renders to a FastWriter but to an OutputStream, which breaks > >my rendering to a string buffer, as a StringWriter does not have > >an OutputStream ???? > > Template can also render directly to a String. I am getting IllegalStateException from the following public class WebmacroTemplate implements Template { private org.webmacro.Template template; public WebmacroTemplate(org.webmacro.Template t) { template =3D t; } /** * @param out A {@link MelatiWebmacroWriter}. */ public void write(MelatiWriter out, TemplateContext templateContext,=20 TemplateEngine engine) throws TemplateEngineException= { try { WebContext wc =3D (WebContext)templateContext.getContext(); if (out instanceof MelatiStringWriter) { String o =3D template.evaluateAsString(wc); wc.getResponse().getWriter().write(o); } else { OutputStream o =3D ((MelatiWebmacroWriter)out).getOutputStream();= =20 template.write(o, wc); } } catch (ContextException e) { throw new TemplateEngineException(e); } catch (IOException e) { throw new TemplateEngineException(e); } } } going to bed, my eyes hurt Tim Pizey |
From: Brian G. <br...@qu...> - 2004-02-27 23:16:28
|
>The problem seems to be that org.webmacro.Template no longer >renders to a FastWriter but to an OutputStream, which breaks >my rendering to a string buffer, as a StringWriter does not have >an OutputStream ???? Template can also render directly to a String. -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |
From: Keats <ke...@xa...> - 2004-02-27 19:04:34
|
I glanced briefly at the code ... I can see that you have a bit of a job ahead. In WebmacroTemplate, try just replacing: template.write(fw, (WebContext)templateContext.getContext()); with WebContext wc = (WebContext)templateContext.getContext(); template.write(wc.getRequest().getOutputStream(), wc); If you already have your content rendered to a String, than you can just write straight to the request: request.getWriter(expandedTemplate); You should be able to rip out all the various wrapper classes that use the FastWriter. Hope this helps. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Friday, February 27, 2004 11:24 AM Subject: Re: [WebMacro-user] Problems upgrading Melati to WebMacro 2.0b1 On Friday 27 February 2004 4:04 pm, Keats wrote: > I'd be willing to change the default behaviour of $Form to return empty > strings instead of nulls, as this seems more useful. Any objections? I may not have correctly analysed what is causing the new behaviour, but it seems good not to change the way things work. > I would also add a method to check if a parameter exist, e.g., > $Form.Exists.formVar. That seems useful. > btw, what problems are you having with FastWriter? You should be able to > just ignore it altogether with 2.0. Would that that were true. Tim Joyce 'understood' the FastWriter and used it pervasively. In trying to remove it I have broken everything. The first symptom [1] was given Template A abd templets b and c evaluated within it I got output bcA I then fiddled some more. The problem seems to be that org.webmacro.Template no longer renders to a FastWriter but to an OutputStream, which breaks my rendering to a string buffer, as a StringWriter does not have an OutputStream ???? http://melati.org/cgi-bin/cvsweb.cgi/melati/src/org/melati/template/webmacro/WebmacroTemplate.java.diff?r1=1.8&r2=1.9 shows you the 1st change I made to get to [1] above. I could really do with some help. cheers timp ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Webmacro-user mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-user |
From: Tim P. <ti...@pa...> - 2004-02-27 16:37:05
|
On Friday 27 February 2004 4:04 pm, Keats wrote: > I'd be willing to change the default behaviour of $Form to return empty > strings instead of nulls, as this seems more useful. Any objections? I may not have correctly analysed what is causing the new behaviour,=20 but it seems good not to change the way things work. > I would also add a method to check if a parameter exist, e.g., > $Form.Exists.formVar. That seems useful.=20 > btw, what problems are you having with FastWriter? You should be able = to > just ignore it altogether with 2.0. Would that that were true.=20 Tim Joyce 'understood' the FastWriter and used it pervasively.=20 In trying to remove it I have broken everything.=20 The first symptom [1] was given Template A abd templets b and c=20 evaluated within it I got output=20 bcA I then fiddled some more.=20 The problem seems to be that org.webmacro.Template no longer=20 renders to a FastWriter but to an OutputStream, which breaks=20 my rendering to a string buffer, as a StringWriter does not have=20 an OutputStream ???? http://melati.org/cgi-bin/cvsweb.cgi/melati/src/org/melati/template/webma= cro/WebmacroTemplate.java.diff?r1=3D1.8&r2=3D1.9 shows you the 1st change I made to get to [1] above.=20 I could really do with some help.=20 cheers timp |
From: Keats <ke...@xa...> - 2004-02-27 16:15:04
|
I'd be willing to change the default behaviour of $Form to return empty strings instead of nulls, as this seems more useful. Any objections? I would also add a method to check if a parameter exist, e.g., $Form.Exists.formVar. btw, what problems are you having with FastWriter? You should be able to just ignore it altogether with 2.0. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Friday, February 27, 2004 10:09 AM Subject: Re: [WebMacro-user] Problems upgrading Melati to WebMacro 2.0b1 On Friday 27 February 2004 2:50 pm, Keats wrote: > Hey Tim, > > I'm not aware of any change to the $Form tool, but perhaps some other > change impacted this. Something has definitely changed since 1.1, $Form.unusedVariable produced "", now throws exception. >Anyway the recommended approach AFAIK is: > > #if ($Form.unusedVariable){ -- do something -- } > > This is a bit tedious. I have added a method to the Form class called > getNoNull(), so you can just say: > > $Form.NoNull.someField > > which will return the value of "someField" or an empty string. I can > commit this if noone objects. What about changing the behavior of $Form (not the general behaviour of null handling) ? > > Keats thanks TimP I am having a horrible time with the FastWriter code. |
From: Keats <ke...@xa...> - 2004-02-27 16:14:34
|
I'd be willing to change the default behaviour of $Form to return empty strings instead of nulls, as this seems more useful. Any objections? I would also add a method to check if a parameter exist, e.g., $Form.Exists.formVar. btw, what problems are you having with FastWriter? You should be able to just ignore it altogether with 2.0. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Friday, February 27, 2004 10:09 AM Subject: Re: [WebMacro-user] Problems upgrading Melati to WebMacro 2.0b1 On Friday 27 February 2004 2:50 pm, Keats wrote: > Hey Tim, > > I'm not aware of any change to the $Form tool, but perhaps some other > change impacted this. Something has definitely changed since 1.1, $Form.unusedVariable produced "", now throws exception. >Anyway the recommended approach AFAIK is: > > #if ($Form.unusedVariable){ -- do something -- } > > This is a bit tedious. I have added a method to the Form class called > getNoNull(), so you can just say: > > $Form.NoNull.someField > > which will return the value of "someField" or an empty string. I can > commit this if noone objects. What about changing the behavior of $Form (not the general behaviour of null handling) ? > > Keats thanks TimP I am having a horrible time with the FastWriter code. |
From: Tim P. <ti...@pa...> - 2004-02-27 15:22:12
|
On Friday 27 February 2004 2:50 pm, Keats wrote: > Hey Tim, > > I'm not aware of any change to the $Form tool, but perhaps some other > change impacted this. =20 Something has definitely changed since 1.1,=20 $Form.unusedVariable produced "", now throws exception.=20 >Anyway the recommended approach AFAIK is: > > #if ($Form.unusedVariable){ -- do something -- } > > This is a bit tedious. I have added a method to the Form class called > getNoNull(), so you can just say: > > $Form.NoNull.someField > > which will return the value of "someField" or an empty string. I can > commit this if noone objects. What about changing the behavior of $Form=20 (not the general behaviour of null handling) ? > > Keats thanks TimP I am having a horrible time with the FastWriter code. |
From: Keats <ke...@xa...> - 2004-02-27 15:01:02
|
Hey Tim, I'm not aware of any change to the $Form tool, but perhaps some other change impacted this. Anyway the recommended approach AFAIK is: #if ($Form.unusedVariable){ -- do something -- } This is a bit tedious. I have added a method to the Form class called getNoNull(), so you can just say: $Form.NoNull.someField which will return the value of "someField" or an empty string. I can commit this if noone objects. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Friday, February 27, 2004 5:44 AM Subject: [WebMacro-user] Problems upgrading Melati to WebMacro 2.0b1 Hi Gang, Thanks to some help from Brian to get me kick started I have got melati mostly converted to Classic 2.0b1, but I am getting different behavior to previously, as templets are all being rendered at the top of the page, before the start of the template they are called from. Also the behaviour of null handling has changed, so $Form.unusedVariable now throws org.webmacro.PropertyException$NullValueException What is the best practice for handling null varianbles? Is there a switch to return to the old behaviour? I have rushed in and committed these changes, so now need to get through to the other side, as I hate backing out code. Melati CVS is uptodate, ie not working. Any advice/help much appreciated. Now might be a good time to try out Melati, like you have been planning to for years ;) All you ned to do is cvs download cd build ant go and point a browser at http://localhost:8080/ cheers tim pizey ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Webmacro-user mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-user |
From: Tim P. <ti...@pa...> - 2004-02-27 10:57:40
|
Hi Gang,=20 Thanks to some help from Brian to get me kick started I have got melati mostly converted to Classic 2.0b1,=20 but I am getting different behavior to previously, as templets are all be= ing=20 rendered at the top of the page, before the start of the template they ar= e=20 called from. Also the behaviour of null handling has changed,=20 so $Form.unusedVariable now throws=20 org.webmacro.PropertyException$NullValueException What is the best practice for handling null varianbles? Is there a switch to return to the old behaviour? I have rushed in and committed these changes,=20 so now need to get through to the other side, as I hate backing out code.= =20 Melati CVS is uptodate, ie not working. Any advice/help much appreciated. Now might be a good time to try out Melati,=20 like you have been planning to for years ;) All you ned to do is=20 cvs download cd build ant go and point a browser at http://localhost:8080/ cheers tim pizey |
From: Keats <ke...@xa...> - 2004-02-26 15:33:18
|
I just looked at the code to refresh my memory. There are three variables supplied by the #eval directive: $OuterVars - a reference to the local variable map of the top level calling context. $Self - a reference to the templet itself (useful for recursive calls). $EvalDepth - current depth of recursion. I'll update the Wiki page accordingly. Keats ----- Original Message ----- From: "Keats" <ke...@xa...> To: <web...@li...> Sent: Thursday, February 26, 2004 9:26 AM Subject: Re: [WebMacro-user] Templets and scope? > It depends on how you execute it. By default the #eval directive creates a > new context. You can put things into the parent context using an automatic > variable. ($OuterVars I think. I'll have to check and update the docs.) > You can reuse the current context by just evaluating the templet as a > variable. > > Keats > ----- Original Message ----- > From: "Nikhil G. Daddikar" <ng...@ce...> > To: "webmacro" <web...@li...> > Sent: Thursday, February 26, 2004 8:39 AM > Subject: [WebMacro-user] Templets and scope? > > > > If I say #set $foo = "bar" in a templet, is the value of $foo accessible > > outside the templet? > > > > Thanks. > |
From: Keats <ke...@xa...> - 2004-02-26 14:36:19
|
It depends on how you execute it. By default the #eval directive creates a new context. You can put things into the parent context using an automatic variable. ($OuterVars I think. I'll have to check and update the docs.) You can reuse the current context by just evaluating the templet as a variable. Keats ----- Original Message ----- From: "Nikhil G. Daddikar" <ng...@ce...> To: "webmacro" <web...@li...> Sent: Thursday, February 26, 2004 8:39 AM Subject: [WebMacro-user] Templets and scope? > If I say #set $foo = "bar" in a templet, is the value of $foo accessible > outside the templet? > > Thanks. > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Keats <ke...@xa...> - 2004-02-26 14:25:42
|
A templet is built (compiled) and cached along with the template in which it is declared. The template caching is configurable. Also, if you save a reference to a templet you can reuse it indefinitely without rebuilding (compiling). Of course the real potential performance hit is probably with expansion (execution). I don't know if any benchmarking has been done on this, but in general it's a good idea to put performance critical stuff into the Java code rather than the template. Just beware of "premature optimization" -- don't spend time optimizing stuff unless you really see a problem. Keats ----- Original Message ----- From: "Nikhil G. Daddikar" <ng...@ce...> To: "webmacro" <web...@li...> Sent: Thursday, February 26, 2004 8:35 AM Subject: *****SPAM***** [WebMacro-user] Templets & performance > Should I be concerned about performance issues? I have about 500+ > templets. How do I ensure that these templets are compiled, cached and > reused? > > I instantiate a WM object once and use it across the application. Will > this in itself mean I avoid the overhead of compiling templets? > > Thanks. > |
From: Nikhil G. D. <ng...@ce...> - 2004-02-26 13:54:46
|
If I say #set $foo = "bar" in a templet, is the value of $foo accessible outside the templet? Thanks. |
From: Nikhil G. D. <ng...@ce...> - 2004-02-26 13:50:28
|
Should I be concerned about performance issues? I have about 500+ templets. How do I ensure that these templets are compiled, cached and reused? I instantiate a WM object once and use it across the application. Will this in itself mean I avoid the overhead of compiling templets? Thanks. |
From: Brian G. <br...@qu...> - 2004-02-25 23:05:51
|
I took a stab; not sure if it works, but it compiles. Now that FastWriter is totally hidden from the API, you can probably back out MelatiFastWriter too. But this should give you an idea of where to start. |
From: Tim P. <ti...@pa...> - 2004-02-24 00:20:02
|
On Monday 23 February 2004 11:08 pm, Lane Sharman wrote: > Tim, > > Now that you have read this thread,=20 Yes, thanks everyone.=20 > can you recompile with 2.0 classic? > > let me know. 8 files are affected, but I am sure that we should keep up with=20 WebMacro and remove some code which is beginning to rot. I am not sure when I will have time, but I will try to get out a clean=20 snapshot so that work could start.=20 Then as Brian said: use the constructors.=20 yours Tim Pizey [javac]=20 /usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalo ne.java:72: cannot resolve symbol [javac] symbol : constructor WebContext (org.webmacro.Broker) [javac] location: class org.webmacro.servlet.WebContext [javac] _webContext =3D new WebContext(_wm.getBroker()); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalo ne.java:87: cannot resolve symbol [javac] symbol : method destroy () [javac] location: interface org.webmacro.WebMacro [javac] _wm.destroy(); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalo ne.java:126: cannot resolve symbol [javac] symbol : method newInstance=20 (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) [javac] location: class org.webmacro.servlet.WebContext [javac] WebContext c =3D _webContext.newInstance(req,resp= ); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalo ne.java:151: cannot resolve symbol [javac] symbol : method write=20 (org.webmacro.FastWriter,org.webmacro.servlet =2EWebContext) [javac] location: interface org.webmacro.Template [javac] t.write(fw, c); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/test/WebmacroMelatiSe rvletTest.java:92: cannot resolve symbol [javac] symbol : method write=20 (org.webmacro.FastWriter,org.webmacro.Context ) [javac] location: interface org.webmacro.Template [javac] template.write(fmw.getPeer(), context2); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/template/webmacro/Web macroTemplate.java:79: cannot resolve symbol [javac] symbol : method write=20 (org.webmacro.FastWriter,org.webmacro.servlet =2EWebContext) [javac] location: interface org.webmacro.Template [javac] template.write(fw,=20 (WebContext)templateContext.getContext()); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/template/webmacro/Web = =20 macroTemplateEngine.java:91: cannot resolve symbol [javac] symbol : constructor WebContext (org.webmacro.Broker) [javac] location: class org.webmacro.servlet.WebContext [javac] _webContext =3D new WebContext(wm.getBroker()); [javac] ^ [javac]=20 /usr/local/packages/dist/melati/src/org/melati/template/webmacro/Web = =20 macroTemplateEngine.java:105: cannot resolve symbol [javac] symbol : method newInstance=20 (javax.servlet.http.HttpServletRequest, = =20 javax.servlet.http.HttpServletResponse) [javac] location: class org.webmacro.servlet.WebContext [javac] WebContext wc =3D _webContext.newInstance(melati.getReque= st(), [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -deprecation for details. [javac] 8 errors |
From: Lane S. <la...@op...> - 2004-02-23 23:12:18
|
Tim, Now that you have read this thread, can you recompile with 2.0 classic? let me know. -Lane Tim Pizey wrote: >On Sunday 15 February 2004 8:40 pm, Eric Ridge wrote: > > >>It's been a long time coming, but it is finally here. We are pleased >>to announce that WebMacro 2.0b1 has been released! >> >>Please download it (http://www.webmacro.org/DownloadWebMacro) and help >>us test! >> >> >The Melati Admin system works, unrecompiled, with webmacro-minimal-2.0b1.jar >however with webmacro-classic-2.0b1.jar produces the following > >10:12:23 AM broker NOTICE starting org.webmacro.Broker: >WebMacro.properties >10:12:23 AM broker NOTICE Loaded settings from WebMacro.defaults, >WebMacro.properties, (System Properties) >10:12:23 AM wm NOTICE new WebMacro(WebMacro.properties) v2.0b1 >java.lang.NoSuchMethodError: org.webmacro.servlet.WebContext: method ><init>(Lorg/webmacro/Broker;)V not found > at >org.apache.jserv.JServServletManager.load_init(JServServletManager.java:589) > at >org.apache.jserv.JServServletManager.loadServlet(JServServletManager.java:498) > at >org.apache.jserv.JServConnection.processRequest(JServConnection.java:269) > at org.apache.jserv.JServConnection.run(JServConnection.java:188) > at java.lang.Thread.run(Thread.java:534) > > >In fact both jars break org.melati.test.WebmacroStandalone > > > >>Thanks for your support and time. >> >>eric >> >>- Some small signature changes to methods require you to recompile >> source code which imports files from webmacro.jar >> >> > >Tried to recompile and got this: > > > [javac] >/usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalone.java:72: >cannot resolve symbol > [javac] symbol : constructor WebContext (org.webmacro.Broker) > [javac] location: class org.webmacro.servlet.WebContext > [javac] _webContext = new WebContext(_wm.getBroker()); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalone.java:87: >cannot resolve symbol > [javac] symbol : method destroy () > [javac] location: interface org.webmacro.WebMacro > [javac] _wm.destroy(); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalone.java:126: >cannot resolve symbol > [javac] symbol : method newInstance >(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) > [javac] location: class org.webmacro.servlet.WebContext > [javac] WebContext c = _webContext.newInstance(req,resp); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/test/WebmacroStandalone.java:151: >cannot resolve symbol > [javac] symbol : method write >(org.webmacro.FastWriter,org.webmacro.servlet.WebContext) > [javac] location: interface org.webmacro.Template > [javac] t.write(fw, c); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/test/WebmacroMelatiServletTest.java:92: >cannot resolve symbol > [javac] symbol : method write >(org.webmacro.FastWriter,org.webmacro.Context) > [javac] location: interface org.webmacro.Template > [javac] template.write(fmw.getPeer(), context2); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/template/webmacro/WebmacroTemplate.java:79: >cannot resolve symbol > [javac] symbol : method write >(org.webmacro.FastWriter,org.webmacro.servlet.WebContext) > [javac] location: interface org.webmacro.Template > [javac] template.write(fw, >(WebContext)templateContext.getContext()); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/template/webmacro/WebmacroTemplateEngine.java:91: >cannot resolve symbol > [javac] symbol : constructor WebContext (org.webmacro.Broker) > [javac] location: class org.webmacro.servlet.WebContext > [javac] _webContext = new WebContext(wm.getBroker()); > [javac] ^ > [javac] >/usr/local/packages/dist/melati/src/org/melati/template/webmacro/WebmacroTemplateEngine.java:105: >cannot resolve symbol > [javac] symbol : method newInstance >(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) > [javac] location: class org.webmacro.servlet.WebContext > [javac] WebContext wc = _webContext.newInstance(melati.getRequest(), > [javac] ^ > [javac] Note: Some input files use or override a deprecated API. > [javac] Note: Recompile with -deprecation for details. > [javac] 8 errors > >BUILD FAILED > >So I guess Melati will be sticking with 1.1 > >yours >Tim Pizey > > > >------------------------------------------------------- >SF.Net is sponsored by: Speed Start Your Linux Apps Now. >Build and deploy apps & Web services for Linux with >a free DVD software kit from IBM. Click Now! >http://ads.osdn.com/?ad_id56&alloc_id438&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > -- Lane Sharman For Protection from SPAM and Virus, Extend to the Network Your Perimeter of Defense: http://www.opendoors.com 858-755-2868 |