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. >> >> >> >> > > > |