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: Keats K. <ke...@xa...> - 2005-05-20 22:07:42
|
It needs the servletContext *and* the classloader for the servletContext. WM can get both from the Servlet, which is why it was done that way. I don't think there is a guaranteed way to get the servlet classloader from the servletContext. Let's not break all the old WM servlet code. However if you want to be explicitly pass in both arguments, I don't see any problem with that. Keats Endre Stølsvik wrote: >The WM constructor taking a servlet, doesn't that really just need the >servletContext or what it is? > >What about making a constructor that takes the argument that is really >needed, instead of having a constructor that takes an argument which is >instantly asked for another object? Pretty please before 2.0. > >Endre > > > > |
From: Keats K. <ke...@xa...> - 2005-05-20 14:54:33
|
I don't have a problem with adding this constructor to WM and adding a corresponding getBroker method to the ServletBroker. In fact the other constructors could delegate to this one so we don't have duplicate code paths. However, I don't see any need to make the Broker constructor non-private. Maybe you can explain. Also I don't understand why you think the classloader will not work if WM is in a shared path. A webapp classloader should delegate to it's parent if it can't find a resource. Keats Marc Palmer wrote: >Hi, > >I've just, very easily, got a basic Spring view implementation working >with WebMacro. This means I have successfully used basic test Spring web >applications with either JSP front end using a WM Taglib to use WM within >the JSP, as well as a no-JSP application that only uses WM templates for >the view. > >I have yet again run into issues with WM's Broker mechanism. I still >strongly believe this is a major thorn in our sides and it needs to be >removed or reworked. > >Basically in the Spring WM view implementation we have access only to our >ServletContext, not the Servlet. All WM + Broker's constructors/factories >need a Servlet if you want to be able to access templates from the >webapp's directories/classpath. > >So for example, I have had to create a new "Servlet22BrokerPlus" (because >Servlet22Broker has a private constructor - argh!) and add a new static >getBroker: > >public static Broker getBroker ( > ServletContext sc, > ClassLoader servletClassLoader, > Properties additionalProperties) throws InitException > >In my view implementation I call this method, and I can pass in >servletClassLoader by doing this.getClass().getClassLoader() on the spring >view. Well, this will only work I believe if the webmacro/webmacro Spring >JAR is not in a shared location such as tomcat/shared or tomcat/common/lib >or endorsed. > >So this in itself is imperfect but better than not being able to access >webapp templates at all. I don't know how we can get to the servlet's >classloader from a Spring view class. (it's the webapp classloader we want >of course - clarifying terminology). > >Anyway, I therefore suggest that: > >1. We need to add a new constructor to o.w.WM: > > public WM(ServletContext sc, ClassLoader webappClassLoader); > >...and as a result also new getBroker(ServletContext, ClassLoader, ...) >methods to Servlet20Broker and Servlet22Broker (or ServletBroker if we can >polymorphize it!) > >2. We make these private constructors in ServletXXBroker protected >instead. Private is just such a pain in the ass when you need to do >something like this without tweaking the original WM source. > >What say you guys? > >My Spring view needs more testing obviously but I'll put it forward soon. > > >Cheers > > |
From: Marc P. <ma...@an...> - 2005-05-20 13:30:50
|
Hi, I've just, very easily, got a basic Spring view implementation working with WebMacro. This means I have successfully used basic test Spring web applications with either JSP front end using a WM Taglib to use WM within the JSP, as well as a no-JSP application that only uses WM templates for the view. I have yet again run into issues with WM's Broker mechanism. I still strongly believe this is a major thorn in our sides and it needs to be removed or reworked. Basically in the Spring WM view implementation we have access only to our ServletContext, not the Servlet. All WM + Broker's constructors/factories need a Servlet if you want to be able to access templates from the webapp's directories/classpath. So for example, I have had to create a new "Servlet22BrokerPlus" (because Servlet22Broker has a private constructor - argh!) and add a new static getBroker: public static Broker getBroker ( ServletContext sc, ClassLoader servletClassLoader, Properties additionalProperties) throws InitException In my view implementation I call this method, and I can pass in servletClassLoader by doing this.getClass().getClassLoader() on the spring view. Well, this will only work I believe if the webmacro/webmacro Spring JAR is not in a shared location such as tomcat/shared or tomcat/common/lib or endorsed. So this in itself is imperfect but better than not being able to access webapp templates at all. I don't know how we can get to the servlet's classloader from a Spring view class. (it's the webapp classloader we want of course - clarifying terminology). Anyway, I therefore suggest that: 1. We need to add a new constructor to o.w.WM: public WM(ServletContext sc, ClassLoader webappClassLoader); ...and as a result also new getBroker(ServletContext, ClassLoader, ...) methods to Servlet20Broker and Servlet22Broker (or ServletBroker if we can polymorphize it!) 2. We make these private constructors in ServletXXBroker protected instead. Private is just such a pain in the ass when you need to do something like this without tweaking the original WM source. What say you guys? My Spring view needs more testing obviously but I'll put it forward soon. Cheers |
From: Keats K. <ke...@xa...> - 2005-05-20 05:12:07
|
I spent a couple of hours setting up Tomcat 5.5.9 and cooking up some test cases and I can't reproduce your problem. I put the following into a sandbox template, with no problem. I'm using Win2K with Sun JRE 1.5.0_02. I also tested with Tomcat 4.1 and 5.0 with JDK 1.4.2. Your error indicates that your class wasn't instantiated. You might try putting some logging into the constructor to see what's going on. Also check your BeanDirective security settings. Good luck. Keats Sample WMScript: #bean $testbean = "com.xaltus.wm.Test" scope=session onNew #set $testbean.Num = 2 #end #set $testbean.Num = $testbean.Num * 2 testbean.Num = $testbean.Num<br><br> #bean $counts = "java.util.HashMap" scope=session onNew #set $counts.Hits = 0 #end #set $counts.Hits = $counts.Hits + 1 Number of visits to this page in this session: $counts.Hits<br><br> Rab Wallace wrote: >I recently upgraded to Tomcat 5.5.9 and noticed all my >pages with a #bean...scope=session no longer works >(scope=page works fine), anyone else seen this? > >I tried a simple example: >A simple bean 'com.myteststuff.Test' has a single long >attribute 'value' and a getter & setter. In my >template, I've got: > >#bean $test="com.myteststuff.Test" scope=session >$test.setValue(123) > >results in the exception below. If I switch to >scope=page, everything works fine. Earlier version of >Tomcat also ok. Thanks for any advice. > >Rab Wallace > >ps. this problem exists on both the latest Webmacro >(2.0rc1) and at least the previous version (2.0b1). > > >org.webmacro.PropertyException$NoSuchMethodException: >No public method setValue(123) on variable $test of >class org.webmacro.engine.UndefinedMacro at >jndi:/localhost/metridium_jboss/skins/kelpforest/kelpforest_DefaultMainPage.wm:229.1 > at >org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.java:716) > at >org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorCache.java:163) > at org.webmacro.Context.internalGet(Context.java:383) > at org.webmacro.Context.getProperty(Context.java:443) > at >org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:52) > at >org.webmacro.engine.Variable.write(Variable.java:211) > at org.webmacro.engine.Block.write(Block.java:133) > at >org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:184) > at >org.webmacro.directive.ForeachDirective.write(ForeachDirective.java:177) > at org.webmacro.engine.Block.write(Block.java:145) > at >org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:199) > at >org.webmacro.engine.WMTemplate.write(WMTemplate.java:324) > at >org.webmacro.engine.WMTemplate.evaluateAsString(WMTemplate.java:253) > at >com.metridia.metridium.servlets.MetridiumServlet.renderPageAlias(MetridiumServlet.java:743) > at >com.metridia.metridium.servlets.MetridiumServlet.doGet(MetridiumServlet.java:598) > at >javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > at >javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at >org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > at >org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > at >org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) > at >org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at >org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at >org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > at >org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at >org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) > at >org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) > at >org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) > at >org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) > at >org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) > at >org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) > at java.lang.Thread.run(Unknown Source) > > |
From: Keats K. <ke...@xa...> - 2005-05-20 02:05:00
|
AFAIK the session keyword has always worked fine. The only issue that I recall is it was tied to the servlet session management implementation -- which some folks don't like. My guess is that there was some change in the JSDK that broke this. I'll try to look into it over the weekend. Keats Lane Sharman wrote: > I do not believe the session keyword has ever been propertly > interpreted and handled as session-bound by the #bean directive. > > Keats? > > -Lane > > Rab Wallace wrote: > >> I recently upgraded to Tomcat 5.5.9 and noticed all my >> pages with a #bean...scope=session no longer works >> (scope=page works fine), anyone else seen this? >> >> I tried a simple example: >> A simple bean 'com.myteststuff.Test' has a single long >> attribute 'value' and a getter & setter. In my >> template, I've got: >> >> #bean $test="com.myteststuff.Test" scope=session >> $test.setValue(123) >> >> results in the exception below. If I switch to >> scope=page, everything works fine. Earlier version of >> Tomcat also ok. Thanks for any advice. >> >> Rab Wallace >> >> ps. this problem exists on both the latest Webmacro >> (2.0rc1) and at least the previous version (2.0b1). >> >> >> org.webmacro.PropertyException$NoSuchMethodException: >> No public method setValue(123) on variable $test of >> class org.webmacro.engine.UndefinedMacro at >> jndi:/localhost/metridium_jboss/skins/kelpforest/kelpforest_DefaultMainPage.wm:229.1 >> >> at >> org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.java:716) >> >> at >> org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorCache.java:163) >> >> at org.webmacro.Context.internalGet(Context.java:383) >> at org.webmacro.Context.getProperty(Context.java:443) >> at >> org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:52) >> at >> org.webmacro.engine.Variable.write(Variable.java:211) >> at org.webmacro.engine.Block.write(Block.java:133) >> at >> org.webmacro.directive.IfDirective.write(IfDirective.java:210) >> at org.webmacro.engine.Block.write(Block.java:184) >> at >> org.webmacro.directive.ForeachDirective.write(ForeachDirective.java:177) >> at org.webmacro.engine.Block.write(Block.java:145) >> at >> org.webmacro.directive.IfDirective.write(IfDirective.java:210) >> at org.webmacro.engine.Block.write(Block.java:199) >> at >> org.webmacro.engine.WMTemplate.write(WMTemplate.java:324) >> at >> org.webmacro.engine.WMTemplate.evaluateAsString(WMTemplate.java:253) >> at >> com.metridia.metridium.servlets.MetridiumServlet.renderPageAlias(MetridiumServlet.java:743) >> >> at >> com.metridia.metridium.servlets.MetridiumServlet.doGet(MetridiumServlet.java:598) >> >> at >> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) >> at >> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> at >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) >> >> at >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) >> >> at >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) >> >> at >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) >> >> at >> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) >> >> at >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) >> >> at >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) >> >> at >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) >> >> at >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) >> >> at >> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) >> at >> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) >> at >> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) >> at >> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) >> >> at >> org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) >> at >> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) >> >> at java.lang.Thread.run(Unknown Source) >> > |
From: Lane S. <la...@op...> - 2005-05-19 22:17:24
|
I do not believe the session keyword has ever been propertly interpreted and handled as session-bound by the #bean directive. Keats? -Lane Rab Wallace wrote: >I recently upgraded to Tomcat 5.5.9 and noticed all my >pages with a #bean...scope=session no longer works >(scope=page works fine), anyone else seen this? > >I tried a simple example: >A simple bean 'com.myteststuff.Test' has a single long >attribute 'value' and a getter & setter. In my >template, I've got: > >#bean $test="com.myteststuff.Test" scope=session >$test.setValue(123) > >results in the exception below. If I switch to >scope=page, everything works fine. Earlier version of >Tomcat also ok. Thanks for any advice. > >Rab Wallace > >ps. this problem exists on both the latest Webmacro >(2.0rc1) and at least the previous version (2.0b1). > > >org.webmacro.PropertyException$NoSuchMethodException: >No public method setValue(123) on variable $test of >class org.webmacro.engine.UndefinedMacro at >jndi:/localhost/metridium_jboss/skins/kelpforest/kelpforest_DefaultMainPage.wm:229.1 > at >org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.java:716) > at >org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorCache.java:163) > at org.webmacro.Context.internalGet(Context.java:383) > at org.webmacro.Context.getProperty(Context.java:443) > at >org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:52) > at >org.webmacro.engine.Variable.write(Variable.java:211) > at org.webmacro.engine.Block.write(Block.java:133) > at >org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:184) > at >org.webmacro.directive.ForeachDirective.write(ForeachDirective.java:177) > at org.webmacro.engine.Block.write(Block.java:145) > at >org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:199) > at >org.webmacro.engine.WMTemplate.write(WMTemplate.java:324) > at >org.webmacro.engine.WMTemplate.evaluateAsString(WMTemplate.java:253) > at >com.metridia.metridium.servlets.MetridiumServlet.renderPageAlias(MetridiumServlet.java:743) > at >com.metridia.metridium.servlets.MetridiumServlet.doGet(MetridiumServlet.java:598) > at >javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > at >javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at >org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > at >org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > at >org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) > at >org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at >org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at >org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > at >org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at >org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) > at >org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) > at >org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) > at >org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) > at >org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) > at >org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) > at java.lang.Thread.run(Unknown Source) > > > > > > > > > > > >___________________________________________________________ >Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com > > >------------------------------------------------------- >This SF.Net email is sponsored by Oracle Space Sweepstakes >Want to be the first software developer in space? >Enter now for the Oracle Space Sweepstakes! >http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > |
From: Rab W. <ja...@ya...> - 2005-05-19 07:53:22
|
I recently upgraded to Tomcat 5.5.9 and noticed all my pages with a #bean...scope=session no longer works (scope=page works fine), anyone else seen this? I tried a simple example: A simple bean 'com.myteststuff.Test' has a single long attribute 'value' and a getter & setter. In my template, I've got: #bean $test="com.myteststuff.Test" scope=session $test.setValue(123) results in the exception below. If I switch to scope=page, everything works fine. Earlier version of Tomcat also ok. Thanks for any advice. Rab Wallace ps. this problem exists on both the latest Webmacro (2.0rc1) and at least the previous version (2.0b1). org.webmacro.PropertyException$NoSuchMethodException: No public method setValue(123) on variable $test of class org.webmacro.engine.UndefinedMacro at jndi:/localhost/metridium_jboss/skins/kelpforest/kelpforest_DefaultMainPage.wm:229.1 at org.webmacro.engine.PropertyOperator.getProperty(PropertyOperatorCache.java:716) at org.webmacro.engine.PropertyOperatorCache.getProperty(PropertyOperatorCache.java:163) at org.webmacro.Context.internalGet(Context.java:383) at org.webmacro.Context.getProperty(Context.java:443) at org.webmacro.engine.PropertyVariable.getValue(PropertyVariable.java:52) at org.webmacro.engine.Variable.write(Variable.java:211) at org.webmacro.engine.Block.write(Block.java:133) at org.webmacro.directive.IfDirective.write(IfDirective.java:210) at org.webmacro.engine.Block.write(Block.java:184) at org.webmacro.directive.ForeachDirective.write(ForeachDirective.java:177) at org.webmacro.engine.Block.write(Block.java:145) at org.webmacro.directive.IfDirective.write(IfDirective.java:210) at org.webmacro.engine.Block.write(Block.java:199) at org.webmacro.engine.WMTemplate.write(WMTemplate.java:324) at org.webmacro.engine.WMTemplate.evaluateAsString(WMTemplate.java:253) at com.metridia.metridium.servlets.MetridiumServlet.renderPageAlias(MetridiumServlet.java:743) at com.metridia.metridium.servlets.MetridiumServlet.doGet(MetridiumServlet.java:598) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) ___________________________________________________________ Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com |
From: dinesh t b <di...@se...> - 2005-05-19 07:50:12
|
Keats, This outputs: #include as template myfile.wmt rather than evaluate it. I have included the original message at the bottom of this email, as it got lost or eternally held by webmacro-user-admin. -d. ----- Original Message ----- From: "Keats Kirsch" <ke...@xa...> To: <web...@li...> Sent: Thursday, May 12, 2005 7:58 PM Subject: Re: [WebMacro-user] Re: init/cleanup/shared/ > I'm not quite sure what you're getting at but if you want a deferred > #include you can do this with #templet/#eval. (#macro won't work since > they are evaluated at build time.) > > For example: > > #templet $dynaIncl { \#include as template \$file } > #eval $dynaIncl using { "file": "myfile.wmt" } > > With the newest version of #eval in CVS you can do this in one step: > > #eval "\#include as template \$file" using { "file": "myfile.wmt" } > > Note the need for backslashes to escape the # and $ chars. Otherwise > they will get evaluated prior to the #eval. > > Hope this helps. > > Keats > > dinesh t b wrote: > > >Trying to post it again, as it did not show up > > > >From: "Jason E. Stewart" <ja...@op...> > >Sent: Monday, May 09, 2005 6:15 PM > >Subject: Re: init/cleanup/shared/ > > > > > > > > > >>"dinesh t b" <tbd...@se...> writes: > >> > >> > >> > >>>#macro pantotoparse($file){ > >>> > >>>this is the stuff that goes before the real parse > >>> > >>>#include as template $file > >>> > >>>and the clean up stuff after the parse > >>> > >>>} > >>> > >>>So we can use #pantotoparse("myfoo.wm") instead and we get what we want. > >>> > >>>However this does not compile as #include tries to expand immediately, > >>>and we cannot get the necessary "delay" that we want for the include. > >>> > >>> > >>We should add that we're using the 2.0b of WebMacro. > >> > >>We tried using #eval with a #templet - but this too did not work - > >>the #include got executed at definition time, not at run time. Putting > >>the #include inside a string, inside the #eval didn't work either - > >>it never got executed - instead it just printed the string... > >> > >>Cheers, > >>jas. > >> > >> Trying to redesign pantoto screens, with a friend (Jason Stewart), we feel that it would be nice to have init/cleanup capabilities of mason (Jason has been using Mason for a while) working in a WM setting. Anyway, here was the simple idea that we tried, to have the capability of init and cleanup. The problem is that when ever we have an #include (as template) we would like to include some "init" WM script and "cleanup" WM Script. And we assumed this could be done simply by using a directive or a macro which would be our own parse, say #pantotoparse #macro pantotoparse($file){ this is the stuff that goes before the real parse #include as template $file and the clean up stuff after the parse } So we can use #pantotoparse("myfoo.wm") instead and we get what we want. However this does not compile as #include tries to expand immediately, and we cannot get the necessary "delay" that we want for the include. Any ideas on how this can be achieved. -dinesh The related email from over two years ago: ----- Original Message ----- From: <tbd...@se...> To: <eb...@tc...>; <web...@li...>; <di...@se...> Sent: Sunday, December 15, 2002 11:24 AM Subject: Re: [WebMacro-user] question: print wm file name/set path dynamically Eric thanks! Will try that. Now i need to add this to the beginning of each file. We do use 1.0+ >> 2. how to prepend or append to the parse-able text > >I'm not sure I understand this one. :) This is related to the above. If I do not want to modify each file, but am able to conditionally trun on or off this from the program, then I would want to add the line automatically for the parse-able text (the file to be parsed) -- say by extending the behaviour of #parse ? thanks much, dinesh Original Message: ----------------- From: Eric B. Ridge eb...@tc... Date: Sat, 14 Dec 2002 23:49:09 -0500 To: web...@li..., di...@se... Subject: Re: [WebMacro-user] question: print wm file name/set path dynamically On Saturday, December 14, 2002, at 11:17 PM, t b dinesh wrote: > > Hello hello, > > We seem to have gathered a large collection of .wm files that use each > other! > We have a need to print the file name on screen for testing/debugging > purposes. > Say we want the text <img src="name.gif" alt=[this file name]> or such > to be prepended or appended to the file that is #include-d or #parse-d. > 1. how to get the file name; and If you put the context in the context: context.put ("Context", context); from your templates, you can do this: This file is: $Context.CurrentLocation This will give you the filename (if there is one) of the current template, plus the line.col in the template that is currently being evaluated. This assumes you're using a 1.0+ version of WM. I don't think context.getCurrentLocation() existed prior to 1.0. > 2. how to prepend or append to the parse-able text I'm not sure I understand this one. :) eric -------------------------------------------------------------------- -- This message was scanned for spam and viruses by BitDefender at www.consultplanet.com |
From: Lane S. <la...@op...> - 2005-05-18 16:26:32
|
> and noticed you seem to have missed out the version number in the SF > package title. fixed. |
From: Lane S. <la...@op...> - 2005-05-18 16:25:21
|
Keats Kirsch wrote: > Marc Palmer wrote: Go, marc, Go! |
From: Keats K. <ke...@xa...> - 2005-05-18 14:49:41
|
Marc Palmer wrote: >Hi guys, > >I have a WM JSP taglib working here. It works like this... in your JSP >page you do: > ><wm:template> > #foreach $reason in ["a", "very", "long", "list"] > Use webmacro! > #end ></wm:template> > > This is cool Marc. I did one of these a couple of years back, but I've lost track of my code. One thing remember that I found useful was to add an optional "id" attribute to the tag so that error messages could reference the specific tag where they occurred. (Unfortunately the WM error messages refer to locations relative to the start of the tag content, not the JSP. If you find a way around this I'd be interested in hearing about it.) I'm actually in a JSP shop now as well :-( so if we could get this into the release it might help me sneak some WM in here as well! >I also have (currently untested) support for (which Velocity JSP taglib >doesn't do): > ><wm:template template="someTemplatePath.wm"/> > >However there are issues with template resolution in webapps - I can't >create WM to use a Servlet as there may not be one that can apply to the >taglib. > > I'm not sure what your issue is here. Can you explain a bit more? >What I am now adding is a context tool to allow the WM script to access >the attributes of the JSP page in their various scopes (AKA scoped page >variables, scoped to page, session or request) > >I'm not sure about the nicest way to achieve this. I'm currently working >along the lines of: > ><wm:template> >This is from the JSP page context: $Attributes.Session.SomeSessionVar >This is from the JSP page context: $Attributes.Page.SomePageVar >This is from the JSP page context: $Attributes.Request.SomeRequestVar ></wm:template> > >This would be quite a nice way to tackle the scoping problem without >requiring method calls (one of the main benefits of WM over JSP). > > I believe I just dropped the JspContext into the WM Context, so I could access all the JSP vars as $JSP.myvar, etc. However I have been toying for a long time with adding scoped variables capabilities into WM. (We already have this with the #bean directive.) I was thinking of something similar to what you've outlined, e.g., $Ctx.Global.MyGlobalVar $Ctx.Session.MySessionVar $Ctx.Page.MyPageVar (same as $MyPageVar of course) Then to get something from the most local scope, like JSP does, you could say: $Ctx.Var.MyVar or something like that. >One thing that is annoying me is that we still can't seem to write >templates out to a Writer, only a FastWriter or OutputStream. > >In some ways this is good but in others it seems to suck. i.e. in JSP-land >the taglib has access only to a pre-constructed JspWriter to write out the >content. Currently I have to get ugly and create a ByteArrayOutputStream, >write to there, convert that to a String, then write that to the writer. >Quite nasty - although it does allow our WM evalution to be atomic - i.e. >any errors we can just dump a single error text to the JSP output. > > Can you give examples of when you need this functionality? If I understand the use-cases, maybe I can help think of solutions. >I'll keep you all posted on the progress of this. We have a bunch of >legacy JSP pages here we will probably be converting to use this taglib so >there will be plenty of lessons learned, which I will put on the Wiki >eventually. > > Looking forward to it! Keats >Cheers > > > |
From: Marc P. <ma...@an...> - 2005-05-18 09:38:07
|
Hi guys, I have a WM JSP taglib working here. It works like this... in your JSP page you do: <wm:template> #foreach $reason in ["a", "very", "long", "list"] Use webmacro! #end </wm:template> I also have (currently untested) support for (which Velocity JSP taglib doesn't do): <wm:template template="someTemplatePath.wm"/> However there are issues with template resolution in webapps - I can't create WM to use a Servlet as there may not be one that can apply to the taglib. What I am now adding is a context tool to allow the WM script to access the attributes of the JSP page in their various scopes (AKA scoped page variables, scoped to page, session or request) I'm not sure about the nicest way to achieve this. I'm currently working along the lines of: <wm:template> This is from the JSP page context: $Attributes.Session.SomeSessionVar This is from the JSP page context: $Attributes.Page.SomePageVar This is from the JSP page context: $Attributes.Request.SomeRequestVar </wm:template> This would be quite a nice way to tackle the scoping problem without requiring method calls (one of the main benefits of WM over JSP). One thing that is annoying me is that we still can't seem to write templates out to a Writer, only a FastWriter or OutputStream. In some ways this is good but in others it seems to suck. i.e. in JSP-land the taglib has access only to a pre-constructed JspWriter to write out the content. Currently I have to get ugly and create a ByteArrayOutputStream, write to there, convert that to a String, then write that to the writer. Quite nasty - although it does allow our WM evalution to be atomic - i.e. any errors we can just dump a single error text to the JSP output. I'll keep you all posted on the progress of this. We have a bunch of legacy JSP pages here we will probably be converting to use this taglib so there will be plenty of lessons learned, which I will put on the Wiki eventually. Cheers |
From: Lane S. <la...@op...> - 2005-05-18 00:32:54
|
On a further note, new developers should look at o.w.servlets.TemplateServlet in WM 2, which provides an alternative to subclassing WMServlet. It uses an interface delegate, ServletRouter, to accept delegation calls if defined. If there is an implementation of ServletRouter, it will trap all requests. The implementation of this type is a single method handle(...) method. All of the plumbing for global processing, broker iniitialization, etc, etc, is handled in TemplateServlet. TS can serve up any type of page, including, of course, static HTML pages. The context is a web context, of course. This kind of composition I think makes it a little easier to work with a servlet and WM at the same time. -Lane Keats Kirsch wrote: > Change your code to: > > WM _wm = new WM(this); > > and you should be able to use all the WebContextTools that you care to > configure. > > Keats > > Peter Smith wrote: > >> I think I've failed to effectively communicate my >> situation. Here's another try: >> >> Is it possible to implicitly access the HttpServletRequest object >> in a WebMacro template (in a servlet environment), just as in a JSP >> page? >> >> My servlet extends only HttpServlet, and I create a WM >> instance within my servlet's init() method using the >> following code: >> >> WM _wm = new WM(); >> >> I presume that manually putting the HttpServletRequest >> object into the Context will work for me, but I want >> to know if I can get away with not doing that - like I >> can with defining global 'Functions' in >> WebMacro.properties. >> >> Thanks! >> >> >> >> --- Keats Kirsch <ke...@xa...> wrote: >> >> >>> From: Keats Kirsch <ke...@xa...> >>> To: web...@li... >>> Subject: Re: Fwd: [WebMacro-user] how to use Request >>> and other 'special objects'? >>> Date: Tue, 17 May 2005 13:14:26 -0400 >>> >>> WM basically operates in two modes, Servlet or >>> stand-alone, depending on how you initialize the WM object. If you >>> instantiate WM with a Servlet instance, it can access the the Web >>> application >>> context, so it uses a WebContext and tools that rely on this, like the >>> RequestTool, SessionTool, CookieTool, etc, will work. If you >>> extend WMServlet, this happens automatically. >>> >>> Hope this helps. >>> >>> Keats >>> >>> Peter Smith wrote: >>> >>> >>> >>>> Seems I've gotten a bit closer. I added the >>>> >>> >>> following >>> >>> >>>> entry to my WebMacro.defaults: >>>> >>>> >>>> >>> >> ContextTools.Request=org.webmacro.servlet.RequestTool >> >> >>>> This I decided to do after finding an email in the >>>> archives referring to: >>>> >>>> ContextTools.Manipulate: >>>> com.acme.wm.ContextManipulator >>>> >>>> But this produces the following error: >>>> >>>> context ERROR Unable to initialize ContextTool: >>>> Request >>>> org.webmacro.PropertyException: This only works >>>> >>> >>> with >>> >>> >>>> WebContext >>>> java.lang.ClassCastException... >>>> >>>> What am I missing? >>>> >>>> >>>> --- Peter Smith <sh...@ya...> wrote: >>>> >>>> >>>> >>>> >>>>> From: Peter Smith <sh...@ya...> >>>>> To: web...@li... >>>>> Subject: [WebMacro-user] how to use Request and >>>>> other 'special objects'? >>>>> Date: Tue, 17 May 2005 08:26:29 -0700 (PDT) >>>>> >>>>> Looking for some doc on using Request and other >>>>> 'context tools' - couldn't find on site. >>>>> First question - can I pass anything other than >>>>> Strings as arguments to my globally-defined >>>>> >>>> >>> template >>> >>> >>>>> functions? I'm getting the following error when >>>>> trying to pass '$Request' as an argument: >>>>> >>>>> ============ >>>>> java.lang.UnsupportedOperationException: Cannot >>>>> invoke toString() on an undefined variable. >>>>> ============ >>>>> >>>>> Thanks. >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >>> >> >> ------------------------------------------------------- >> >> >>> This SF.Net email is sponsored by Oracle Space >>> Sweepstakes >>> Want to be the first software developer in space? >>> Enter now for the Oracle Space Sweepstakes! >>> >>> >> >> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click >> >> >>> _______________________________________________ >>> Webmacro-user mailing list >>> Web...@li... >>> >>> >> >> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> >> --peter-- http://shmooth.blogspot.com/ >> >> >> >> Yahoo! Mail >> Stay connected, organized, and protected. Take the tour: >> http://tour.mail.yahoo.com/mailtour.html >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by Oracle Space Sweepstakes >> Want to be the first software developer in space? >> Enter now for the Oracle Space Sweepstakes! >> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click >> _______________________________________________ >> Webmacro-user mailing list >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/webmacro-user >> >> >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > |
From: Lane S. <la...@op...> - 2005-05-18 00:23:42
|
Marc Palmer wrote: > Lane Sharman wrote: > >> Friends, >> >> WM RC1 is out there. This is great news and long overdue! > > > You mean WM 2 RC1? I downloaded it today at work - and noticed you > seem to have missed out the version number in the SF package title. Yes. That is what I mean. I will get the package title right too! > > > Great work on this guys... and guess what, I'm currently working on a > WM -enabling Taglib for JSP (boo hiss, let's get in the back door!) Many thanks to Keats for his contribs as well. > > > ...and after that I will probably take my own stab at the Spring M+V > for WM. that would be a fantastic contribution. -Lane > > >> Please start using this. Report any errors and create some pages on >> www.webmacro.org where you feature your app. I will place these web >> addresses in the Press release! > > > > Cheers > |
From: Marc P. <ma...@an...> - 2005-05-17 21:02:01
|
Lane Sharman wrote: > Friends, > > WM RC1 is out there. This is great news and long overdue! You mean WM 2 RC1? I downloaded it today at work - and noticed you seem to have missed out the version number in the SF package title. Great work on this guys... and guess what, I'm currently working on a WM -enabling Taglib for JSP (boo hiss, let's get in the back door!) ...and after that I will probably take my own stab at the Spring M+V for WM. > Please start using this. Report any errors and create some pages on > www.webmacro.org where you feature your app. I will place these web > addresses in the Press release! Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Lane S. <la...@op...> - 2005-05-17 20:22:46
|
Friends, WM RC1 is out there. This is great news and long overdue! Please start using this. Report any errors and create some pages on www.webmacro.org where you feature your app. I will place these web addresses in the Press release! Use it. enjoy it. -Lane |
From: Peter S. <sh...@ya...> - 2005-05-17 20:07:02
|
OK, fixed it. At first I tried this: WM _wm = new WM(this); But that was getting me some nice NullPointerExceptions - I eventually figured out that I wasn't calling 'super.init(cfg)' in my servlet's init() method (inherited code, yo!). Fixed. I also tried the WebContext thing, separately, and that worked as well. I didn't realize there was a Context and a WebContext - I'm doing servlet and non-servlet environments and was using Context in both cases. That also worked. Not using WebContext would explain why I was getting the error '$Request is not defined' (or, similar) when I first tried using $Request in a template. Thanks all! --- Marc Palmer <ma...@an...> wrote: > Peter Smith wrote: > > I think I've failed to effectively communicate my > > situation. Here's another try: > > > > Is it possible to implicitly access the > > HttpServletRequest object in a WebMacro > > template (in a servlet environment), just > > as in a JSP page? > > Yes, it works out of the box, in $Request. > > I'm in JSP-land at the moment at work... but am a > seasoned WM user. > > The RequestTool is enabled by default in > Webmacro.defaults for as long > as I can remember, so there is nothing to do to make > this work. > > > What does the following template do for you? > > <html> > <body> > <b>Request is: $Request</b> > </body> > </html> > > ? For as long as I can remember this just works out > of the box, as long > as you are using a WebContext (WM.getWebContext()) > to use when > evaluating the page. > > Cheers > > > -- > Marc Palmer wj...@wa... > > Wangjammers - Java, J2ME and Web Consultants > ~ http://www.wangjammers.org/ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space > Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > --peter-- http://shmooth.blogspot.com/ __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail |
From: Marc P. <ma...@an...> - 2005-05-17 19:11:08
|
Peter Smith wrote: > I think I've failed to effectively communicate my > situation. Here's another try: > > Is it possible to implicitly access the > HttpServletRequest object in a WebMacro > template (in a servlet environment), just > as in a JSP page? Yes, it works out of the box, in $Request. I'm in JSP-land at the moment at work... but am a seasoned WM user. The RequestTool is enabled by default in Webmacro.defaults for as long as I can remember, so there is nothing to do to make this work. What does the following template do for you? <html> <body> <b>Request is: $Request</b> </body> </html> ? For as long as I can remember this just works out of the box, as long as you are using a WebContext (WM.getWebContext()) to use when evaluating the page. Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Keats K. <ke...@xa...> - 2005-05-17 19:03:57
|
Change your code to: WM _wm = new WM(this); and you should be able to use all the WebContextTools that you care to configure. Keats Peter Smith wrote: >I think I've failed to effectively communicate my >situation. Here's another try: > > Is it possible to implicitly access the > HttpServletRequest object in a WebMacro > template (in a servlet environment), just > as in a JSP page? > >My servlet extends only HttpServlet, and I create a WM >instance within my servlet's init() method using the >following code: > > WM _wm = new WM(); > >I presume that manually putting the HttpServletRequest >object into the Context will work for me, but I want >to know if I can get away with not doing that - like I >can with defining global 'Functions' in >WebMacro.properties. > >Thanks! > > > >--- Keats Kirsch <ke...@xa...> wrote: > > >>From: Keats Kirsch <ke...@xa...> >>To: web...@li... >>Subject: Re: Fwd: [WebMacro-user] how to use Request >>and other 'special objects'? >>Date: Tue, 17 May 2005 13:14:26 -0400 >> >>WM basically operates in two modes, Servlet or >>stand-alone, depending on >>how you initialize the WM object. If you >>instantiate WM with a Servlet >>instance, it can access the the Web application >>context, so it uses a >>WebContext and tools that rely on this, like the >>RequestTool, >>SessionTool, CookieTool, etc, will work. If you >>extend WMServlet, this >>happens automatically. >> >>Hope this helps. >> >>Keats >> >>Peter Smith wrote: >> >> >> >>>Seems I've gotten a bit closer. I added the >>> >>> >>following >> >> >>>entry to my WebMacro.defaults: >>> >>> >>> >>> >ContextTools.Request=org.webmacro.servlet.RequestTool > > >>>This I decided to do after finding an email in the >>>archives referring to: >>> >>>ContextTools.Manipulate: >>>com.acme.wm.ContextManipulator >>> >>>But this produces the following error: >>> >>> context ERROR Unable to initialize ContextTool: >>>Request >>> org.webmacro.PropertyException: This only works >>> >>> >>with >> >> >>>WebContext >>> java.lang.ClassCastException... >>> >>>What am I missing? >>> >>> >>>--- Peter Smith <sh...@ya...> wrote: >>> >>> >>> >>> >>>>From: Peter Smith <sh...@ya...> >>>>To: web...@li... >>>>Subject: [WebMacro-user] how to use Request and >>>>other 'special objects'? >>>>Date: Tue, 17 May 2005 08:26:29 -0700 (PDT) >>>> >>>>Looking for some doc on using Request and other >>>>'context tools' - couldn't find on site. >>>> >>>>First question - can I pass anything other than >>>>Strings as arguments to my globally-defined >>>> >>>> >>template >> >> >>>>functions? I'm getting the following error when >>>>trying to pass '$Request' as an argument: >>>> >>>>============ >>>>java.lang.UnsupportedOperationException: Cannot >>>>invoke toString() on an undefined variable. >>>>============ >>>> >>>>Thanks. >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> >> >> >------------------------------------------------------- > > >>This SF.Net email is sponsored by Oracle Space >>Sweepstakes >>Want to be the first software developer in space? >>Enter now for the Oracle Space Sweepstakes! >> >> >> >http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > > >>_______________________________________________ >>Webmacro-user mailing list >>Web...@li... >> >> >> >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > >--peter-- >http://shmooth.blogspot.com/ > > > >Yahoo! Mail >Stay connected, organized, and protected. Take the tour: >http://tour.mail.yahoo.com/mailtour.html > > > >------------------------------------------------------- >This SF.Net email is sponsored by Oracle Space Sweepstakes >Want to be the first software developer in space? >Enter now for the Oracle Space Sweepstakes! >http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > |
From: Peter S. <sh...@ya...> - 2005-05-17 18:58:58
|
I think I've failed to effectively communicate my situation. Here's another try: Is it possible to implicitly access the HttpServletRequest object in a WebMacro template (in a servlet environment), just as in a JSP page? My servlet extends only HttpServlet, and I create a WM instance within my servlet's init() method using the following code: WM _wm = new WM(); I presume that manually putting the HttpServletRequest object into the Context will work for me, but I want to know if I can get away with not doing that - like I can with defining global 'Functions' in WebMacro.properties. Thanks! --- Keats Kirsch <ke...@xa...> wrote: > From: Keats Kirsch <ke...@xa...> > To: web...@li... > Subject: Re: Fwd: [WebMacro-user] how to use Request > and other 'special objects'? > Date: Tue, 17 May 2005 13:14:26 -0400 > > WM basically operates in two modes, Servlet or > stand-alone, depending on > how you initialize the WM object. If you > instantiate WM with a Servlet > instance, it can access the the Web application > context, so it uses a > WebContext and tools that rely on this, like the > RequestTool, > SessionTool, CookieTool, etc, will work. If you > extend WMServlet, this > happens automatically. > > Hope this helps. > > Keats > > Peter Smith wrote: > > >Seems I've gotten a bit closer. I added the > following > >entry to my WebMacro.defaults: > > > > > ContextTools.Request=org.webmacro.servlet.RequestTool > > > >This I decided to do after finding an email in the > >archives referring to: > > > > ContextTools.Manipulate: > >com.acme.wm.ContextManipulator > > > >But this produces the following error: > > > > context ERROR Unable to initialize ContextTool: > >Request > > org.webmacro.PropertyException: This only works > with > >WebContext > > java.lang.ClassCastException... > > > >What am I missing? > > > > > >--- Peter Smith <sh...@ya...> wrote: > > > > > >>From: Peter Smith <sh...@ya...> > >>To: web...@li... > >>Subject: [WebMacro-user] how to use Request and > >>other 'special objects'? > >>Date: Tue, 17 May 2005 08:26:29 -0700 (PDT) > >> > >>Looking for some doc on using Request and other > >>'context tools' - couldn't find on site. > >> > >>First question - can I pass anything other than > >>Strings as arguments to my globally-defined > template > >>functions? I'm getting the following error when > >>trying to pass '$Request' as an argument: > >> > >>============ > >>java.lang.UnsupportedOperationException: Cannot > >>invoke toString() on an undefined variable. > >>============ > >> > >>Thanks. > >> > >> > >> > >> > > > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space > Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > --peter-- http://shmooth.blogspot.com/ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html |
From: Keats K. <ke...@xa...> - 2005-05-17 17:14:30
|
WM basically operates in two modes, Servlet or stand-alone, depending on how you initialize the WM object. If you instantiate WM with a Servlet instance, it can access the the Web application context, so it uses a WebContext and tools that rely on this, like the RequestTool, SessionTool, CookieTool, etc, will work. If you extend WMServlet, this happens automatically. Hope this helps. Keats Peter Smith wrote: >Seems I've gotten a bit closer. I added the following >entry to my WebMacro.defaults: > > ContextTools.Request=org.webmacro.servlet.RequestTool > >This I decided to do after finding an email in the >archives referring to: > > ContextTools.Manipulate: >com.acme.wm.ContextManipulator > >But this produces the following error: > > context ERROR Unable to initialize ContextTool: >Request > org.webmacro.PropertyException: This only works with >WebContext > java.lang.ClassCastException... > >What am I missing? > > >--- Peter Smith <sh...@ya...> wrote: > > >>From: Peter Smith <sh...@ya...> >>To: web...@li... >>Subject: [WebMacro-user] how to use Request and >>other 'special objects'? >>Date: Tue, 17 May 2005 08:26:29 -0700 (PDT) >> >>Looking for some doc on using Request and other >>'context tools' - couldn't find on site. >> >>First question - can I pass anything other than >>Strings as arguments to my globally-defined template >>functions? I'm getting the following error when >>trying to pass '$Request' as an argument: >> >>============ >>java.lang.UnsupportedOperationException: Cannot >>invoke toString() on an undefined variable. >>============ >> >>Thanks. >> >> >> >> > > > |
From: Peter S. <sh...@ya...> - 2005-05-17 16:37:36
|
Seems I've gotten a bit closer. I added the following entry to my WebMacro.defaults: ContextTools.Request=org.webmacro.servlet.RequestTool This I decided to do after finding an email in the archives referring to: ContextTools.Manipulate: com.acme.wm.ContextManipulator But this produces the following error: context ERROR Unable to initialize ContextTool: Request org.webmacro.PropertyException: This only works with WebContext java.lang.ClassCastException... What am I missing? --- Peter Smith <sh...@ya...> wrote: > From: Peter Smith <sh...@ya...> > To: web...@li... > Subject: [WebMacro-user] how to use Request and > other 'special objects'? > Date: Tue, 17 May 2005 08:26:29 -0700 (PDT) > > Looking for some doc on using Request and other > 'context tools' - couldn't find on site. > > First question - can I pass anything other than > Strings as arguments to my globally-defined template > functions? I'm getting the following error when > trying to pass '$Request' as an argument: > > ============ > java.lang.UnsupportedOperationException: Cannot > invoke toString() on an undefined variable. > ============ > > Thanks. > > __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail |
From: Graeme J S. <web...@gj...> - 2005-05-17 15:38:28
|
On Tue, 17 May 2005, Peter Smith wrote: > Looking for some doc on using Request and other > 'context tools' - couldn't find on site. This might help http://www.webmacro.org/ContextTools -- Graeme - |
From: Peter S. <sh...@ya...> - 2005-05-17 15:26:47
|
Looking for some doc on using Request and other 'context tools' - couldn't find on site. First question - can I pass anything other than Strings as arguments to my globally-defined template functions? I'm getting the following error when trying to pass '$Request' as an argument: ============ java.lang.UnsupportedOperationException: Cannot invoke toString() on an undefined variable. ============ Thanks. --peter-- http://shmooth.blogspot.com/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Lane S. <la...@op...> - 2005-05-16 14:57:47
|
Greetings, Keats and I posted RC1 of Release 2.0 on SF. Here is the plan: > Community to start using this release immediately and if no major bugs, it becomes 2.0. > I will prepare a press release and when 2.0 is posted, I will send this out. > Any special uses/examples/plans/projects for WebMacro should be posted on the web site and i will cite these in the Press Release. Kindest, -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |