actionframework-users Mailing List for ActionFramework (Page 8)
Status: Inactive
Brought to you by:
ptoman
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(11) |
Aug
(26) |
Sep
(38) |
Oct
(33) |
Nov
(18) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(26) |
Feb
(7) |
Mar
(3) |
Apr
(14) |
May
(12) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
|
Nov
(5) |
Dec
|
2004 |
Jan
(4) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark D. A. <md...@di...> - 2002-09-18 12:03:42
|
Action.java has this code: for (int i = 0; i < convertedParams.length; i++) try { if (retValue == null) throw new ActionException("Method '" + methodStack[i-1] + "' of action '" + debugName + "' returns null"); That -1 is kind of a problem when i=0..... -mda |
From: Petr T. <cz5...@ti...> - 2002-09-18 08:18:04
|
>I see a fair amount of effort in the source code involving log files, su= ch >as org.actionframework.engines.velocity.VelocityServletLog. > >But I see no documentation. How is it all supposed to work? >What log4j properties are obeyed by actionframework? >If "runtime.log" is specified in Velocity.properites, does the actionfra= mework >relativize it? Or override it? Or add an additional logger? >Right now i've got at least 4 independent libraries doing logging: my co= de, >jetty, actionframework, and velocity. Unfortunately none of them are not= ing >the exception that is happening, so i'm trying to figure out the knobs. AS uses logging support provided by the template engine - ActionServlet.g= etLog() method returns just a wrapper for WM/Vel log. In addition, there is Actio= nServlet.addLog() methods to enable passing log info to other targets (listeners). Petr [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ] _________________________________________________________________ Chcete v=ECd=ECt jak=E9 to je m=EDt =B9est jazyk=F9? Zkuste to na http://= slovnik.tiscali.cz |
From: Mark D. A. <md...@di...> - 2002-09-17 19:33:34
|
I see a fair amount of effort in the source code involving log files, such as org.actionframework.engines.velocity.VelocityServletLog. But I see no documentation. How is it all supposed to work? What log4j properties are obeyed by actionframework? If "runtime.log" is specified in Velocity.properites, does the actionframework relativize it? Or override it? Or add an additional logger? Right now i've got at least 4 independent libraries doing logging: my code, jetty, actionframework, and velocity. Unfortunately none of them are noting the exception that is happening, so i'm trying to figure out the knobs. -mda |
From: Petr T. <cz5...@ti...> - 2002-09-16 08:05:00
|
>When i said "multiple servlets" i should have said "multiple web applica= tions". >The actionframework examples war puts all the servlets into a single web= >application. >That means there is just a single url mapping, and so the bug i mentione= d >doesn't happen. > >However, if you have multiple web apps, things go wrong. Aha. I will look at this issue by the end of this week. If you find a sol= ution by yourself in the meantime, please post it here or through SourceForge. Thank you. Petr [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ] _________________________________________________________________ Chcete v=ECd=ECt jak=E9 to je m=EDt =B9est jazyk=F9? Zkuste to na http://= slovnik.tiscali.cz |
From: Mark D. A. <md...@di...> - 2002-09-16 07:49:36
|
> What is your Velocity.properties configuration? There are multiple servlets > in as_examples.war and they all (should ;-)) work when deployed. When i said "multiple servlets" i should have said "multiple web applications". The actionframework examples war puts all the servlets into a single web application. That means there is just a single url mapping, and so the bug i mentioned doesn't happen. However, if you have multiple web apps, things go wrong. In fact, the way that I found this problem was by trying to reorganize the actionframework examples in a way that will work treating each example as its own web application with its own web.xml file. Currently there are about 3 copies of all the examples, and still it doesn't work out of the box with a standard J2EE container, so far as i can see. In my rearranged version, i have an "examples-src/" directory that: - just has the sources - is not run from - has webmacro syntax Then there is a derived tree under build/webapps that: - will generated vm for velocity or wm for webmacro according to what is asked - will optionally generate all the servletrunner cruft, but not unless asked - will work out of the box with a J2EE standard servlet container It looks like this: build/ webapps/ Calculator/ WEB-INF/ web.xml classes/ Calculator.class vm/ Calculator.vm error.vm config/ Calculator.xml Velocity.properties Calculators/ ... servlet containers such as jetty will run everything under a webapps/ directory automatically. although currently i'm running into various problems with actionframework, such as that class static variable. also, without my patch for getRealPath, it is awkward when an application uses ActionServlet directly without subclassing (because WEB-INF/classes won't be in its classpath because its instance doesn't have that for its classloader). -mda |
From: Petr T. <cz5...@ti...> - 2002-09-16 07:11:36
|
>ActionServlet will attempt to load as File (relying on current directory= ), >and then will attempt servlet.getClass().getResource("/" + f) (relying on >classloader). >WEB-INF/classes will only work if the servlet instance >has a class loader from this webapp, which is not reliable (if for examp= le >the app is using ActionServlet directly and not a subclass). >I have a patch below to ActionRuntime.java to make it attempt a getRealP= ath >also. > >Here is a patch to ActionRuntime.java to make it do a getRealPath as wel= l, Good idea. Thanks for the patch (will be in the next releese)! Petr [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ] _________________________________________________________________ Chcete v=ECd=ECt jak=E9 to je m=EDt =B9est jazyk=F9? Zkuste to na http://= slovnik.tiscali.cz |
From: Petr T. <cz5...@ti...> - 2002-09-16 07:08:56
|
>If there are multiple servlets in a container using the actionframework,= >things don't work. Only the first servlet finds its templates. >At least part of the problem is that VelocityInOutVariable has a static variable >"ri" which holds a shared org.apache.velocity.runtime.RuntimeInstance (a= t least >if using Velocity 1.2). What is your Velocity.properties configuration? There are multiple servle= ts in as_examples.war and they all (should ;-)) work when deployed. Petr [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ] _________________________________________________________________ Chcete v=ECd=ECt jak=E9 to je m=EDt =B9est jazyk=F9? Zkuste to na http://= slovnik.tiscali.cz |
From: Mark D. A. <md...@di...> - 2002-09-16 02:15:50
|
If there are multiple servlets in a container using the actionframework, things don't work. Only the first servlet finds its templates. At least part of the problem is that VelocityInOutVariable has a static variable "ri" which holds a shared org.apache.velocity.runtime.RuntimeInstance (at least if using Velocity 1.2). This is a problem, because RuntimeInstance is the thing that holds the ResourceManagerImpl which holds the FileResourceLoader which holds the search path for templates. Since it is initialized in VelocityInOutVariable in a static clause, no servlet after the first one will ever get its own FileResourceLoader for finding templates. So far as I can make out, fixing this will require changes in a number of places. actionframework's VelocityServlet.java cannot just call its base class's getTemplate() method as that relies on velocity's RuntimeSingleton, which would introduce the same problem. Rather, I think engine/velocity/VelocityServlet.java's loadConfiguration should also instantiate a velocity RuntimeInstance itself. That ri should be used for getTemplate. Furthermore, VelocityInOutVariable's constructor should be changed to either take that ri in its constructor args, or it should cast the ActionServlet to a VelocityServlet and call a getter on it to get the ri. -mda |
From: Mark D. A. <md...@di...> - 2002-09-16 01:57:35
|
Currently things are a bit of a mess about how to resolve unqualified paths in configuration: web.xml/ActionConfig - ActionServlet will attempt to load as File (relying on current directory), and then will attempt servlet.getClass().getResource("/" + f) (relying on classloader). WEB-INF/classes will only work if the servlet instance has a class loader from this webapp, which is not reliable (if for example the app is using ActionServlet directly and not a subclass). I have a patch below to ActionRuntime.java to make it attempt a getRealPath also. web.xml/properties - Done by Velocity. See org.apache.velocity.servlet.VelocityServlet.INIT_PROPS_KEY It tries ServletConfig.getInitParameter and ServletContext.getInitParameter. Then it does getServletContext().getRealPath(propsFile). velocity.properties/file.resource.loader.path - Massaged by actionframework, and used by velocity. In actionframework's org/actionframework/engines/velocity/VelocityServlet.java it does a getRealPath on the value. Here is a patch to ActionRuntime.java to make it do a getRealPath as well, so all three will support that: try { // support for ActionConfig reloading actionConfigFile = new File(configFilename); in = new FileInputStream(actionConfigFile); log.info("loaded '" + configFilename + "' as File"); } catch (FileNotFoundException e) { URL url = servlet.getClass().getResource("/" + configFilename); if (url == null) { String realPath = servlet.getServletContext().getRealPath(configFilename); if ( realPath == null ) { throw new FileNotFoundException("ActionConfig '" + configFilename + "' not found as file, in classpath, or as ServletContext.getRealPath"); } else { in = new FileInputStream(realPath); log.info("loaded '" + configFilename + "' via servlet getRealPath from " + realPath); } } else { actionConfigFile = new File(url.getFile()); in = new FileInputStream(actionConfigFile); log.info("loaded '" + configFilename + "' as resource from " + url.getFile()); } } -mda |
From: Petr T. <Pet...@pi...> - 2002-09-10 20:06:41
|
> hi, i would like te send to a method all the vars i have in a form. > the inputs of the form are named as following: news[0][day], > news[0][month]... so i added the following tag to my actionservlet > config file: <action name = "/record" method = "record(String[][] > news)"> but with no result. if i do it using just string vars it > works with no problem. How do you create multidimensional parameters in HTML? AFAIK, only one-dimensional arrays are supported. If you have in the HTML: <INPUT TYPE="Hidden" NAME="news" VALUE="1"> <INPUT TYPE="Hidden" NAME="news" VALUE="2"> <INPUT TYPE="Hidden" NAME="news" VALUE="3"> then you can use: <action name="/record" method="record(String[] news)"/> Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: <bm...@ho...> - 2002-09-10 17:25:25
|
hi, i would like te send to a method all the vars i have in a form. the inputs of the form are named as following: news[0][day], = news[0][month]... so i added the following tag to my actionservlet config file: <action = name =3D "/record" method =3D "record(String[][] news)"> but with no = result. if i do it using just string vars it works with no problem. any suggestion/tip how to send an array to a method? thx in advance. |
From: Petr T. <Pet...@pi...> - 2002-09-07 13:44:57
|
>> Ah yes... but how can you pass the params arround if you have them >> in a separate namespace? > > via the context. In my context I would like an ActionServlet object I guess this is what I meant: (all) incoming parameters would be put to Context - like those for the action method. Presently, this can be achieved by overriding ActionServlet.handle() method: public Template handle(HttpServletRequest request, HttpServletResponse response, Context context) { for (Enumeration e = request.getParameterNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); String[] values = request.getParameterValues(name); context.put(name, values.length == 1? (Object) values[0]: values); } return super.handle(request, response, context); } > which itself contains thinks like $SERVLET, it's own configuration > and the parameters. I should also be able to get this ActionServlet > object from Action Servlet so it is available even in methods that > are not passed the context. 1) you can access servlet instance in your components: public class MyComponent { private YourServlet servlet; public MyComponent(YourServlet servlet) { this.servlet = servlet. } public Template myMethod(String name) { servlet.getTemplate(name); } } 2) you can put $ActionServlet into Ccontext: public Template handle(HttpServletRequest request, HttpServletResponse response, Context context) { context.put("ActionServlet", this); return super.handle(request, response, context); } 3) you can access ActionServlet instance in ActionConfig: public class ActionServletInstantiator implements Instantiator { private ActionServlet servlet; public DefaultInstantiator(ActionServlet servlet) { this.servlet = servlet; } public Object createComponent(Context context, Class componentClass, String componentName) { return servlet; } } <component name="servlet" class="org.actionframework.ActionServlet" instantiator="ActionServletInstantiator " persistence="application"> <action name="/getTemplate" method="getTemplate(String name)"/> </component> Or did you mean something else? :) > http://www.sf.net/projects/visibleresults Good! I will take a look. Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: David W. <da...@su...> - 2002-09-01 22:16:15
|
Petr, Niw back from holiday so catching up. > >> [ ] enable passing of all HTTP parameters (= put everything to > > > > Yes, providing they are in a special namespace. This avoids the big > > security hole found in php where a cracker could submit variables you > > were not expecting. > > Ah yes... but how can you pass the params arround if you have them in a > separate namespace? via the context. In my context I would like an ActionServlet object which itself contains thinks like $SERVLET, it's own configuration and the parameters. I should also be able to get this ActionServlet object from Action Servlet so it is available even in methods that are not passed the context. > > Thanks for all this. We are going well with ActionServlet at the > > moment with Mandip churning out production quality code nice and > > quick. Erik has also been working on our generic "framework" for all > > our projects using ActionServlet, Velocity, Jrf and a few home grown > > standards. > > Cool! Are you going to make any your generic stuff public? Yes, it is all in a sub project part of VisibleResults and all under the LGPL license. We will be improving the documentation as we go. See the framework cvs module in the visibleresults project at sourceforge. http://www.sf.net/projects/visibleresults Dave -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. |
From: Petr T. <Pet...@pi...> - 2002-09-01 11:25:55
|
One more message today: I unsubscribed all members of as-list (which has moved to https://lists.sourceforge.net/lists/listinfo/actionframework-users, as you know), so you should no longer receive "membership reminder" from Dione. Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: Petr T. <Pet...@pi...> - 2002-09-01 11:25:54
|
Hello, I finally found time to upgrade ActionPack (http://dione.zcu.cz/~toman40/ActionPack). It differs only in one module - ActionServlet: ActionServlet 0.93.1a -> 0.93.1b (0.93.1b contains the same code as 0.93.2b) Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: Petr T. <Pet...@pi...> - 2002-08-13 16:51:53
|
Changes from 0.93.2a to 0.93.2b 13-Aug-2002 ------------------------------- http://www.actionframework.org ------------------------------- - log messages now include [init], [cleanup] or [request id] prefix (request id is taken from Context.hashCode() and may be "unknown" if cannot be determined - for log messages comming from non-request thread, for example) note: applications need not to prepend [request id] to log messages, internal thread-to-context mapping is used to manage prefixes automatically - $SERVLET and $URL variables are now set before ActionServlet.handle() - new org.actionframework.logAllTypeHandlers <property> may be set to "true" to log invocation of all type handlers (by default org.actionframework.* type handlers are excluded from the log) - trailing slash in a new-session URL no longer causes unassigned action - added new RedirectTemplate class - virtual template for URL redirecting from methods with Template return type - see ActionServlet.getTemplate() in API doc - removed internal ContextParameterRetriever class - bugfix: misleading unexpected initialization error was reported when ActionConfig was not found - bugfix: <in/output-variable> evaluated to null on false "if" condition even if some value had been retreived from the request or URL - bugfix: <in/output-variable name="v1" value="$v2"/>s copied $v2 as String - bugfix: parameter retreiving didn't work for <invoke> in some cases - bugfix: show-* attribute ignoring didn't work for nested <invoke> elements - bugfix: composite type definition was not checked against null - bugfix: if no <template> set 'is-new-session' attribute to "true" and newSession() returned null, NullPointerException was thrown - bugfix: if show-value-of returns a template and there is no content type handler found, the template is rendered as usually - bugfix: array values had additional pair of brackets [] in log - bugfix: ConversionException.setParameterValue() was not called in some cases - changes in examples: - build.xml now detects classpath for any version of Velocity automatically, copying of velocity*.jar files to Ant's lib directory is not required - bugfix: SendReceive demo functionality was broken Thanks to everyone for feedback! |
From: Petr T. <Pet...@pi...> - 2002-08-13 16:51:49
|
> for my money, i think its cleaner to simply have no order requirement > for invoke/output-variable elements. OK. Adding this for 0.94 todo. > now, on to a bit of a possible bug. i've actually gone ahead and > done some test coding to allow invoke elements before and after the > output-variable elements in a template (and processed in that order), > and part of what i was doing i initially tried to use input-variable > elements to set some variables from the request, but it seemed to me > that they were never actually executed. i saw this: I fixed some related <invoke> bugs for 0.93.1b/0.93.2b. Please try this version - I hope AS works now as I decribed. Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: Petr T. <Pet...@pi...> - 2002-08-13 16:51:47
|
>> [ ] enable passing of all HTTP parameters (= put everything to > > Yes, providing they are in a special namespace. This avoids the big > security hole found in php where a cracker could submit variables you > were not expecting. Ah yes... but how can you pass the params arround if you have them in a separate namespace? > Thanks for all this. We are going well with ActionServlet at the > moment with Mandip churning out production quality code nice and > quick. Erik has also been working on our generic "framework" for all > our projects using ActionServlet, Velocity, Jrf and a few home grown > standards. Cool! Are you going to make any your generic stuff public? Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |
From: David W. <da...@su...> - 2002-08-09 22:53:14
|
Petr, Some rather delayed comments on your 0.94 proposals, I have ignored items where I have no comment. > [ ] enable passing of all HTTP parameters (= put everything to Context) Yes, providing they are in a special namespace. This avoids the big security hole found in php where a cracker could submit variables you were not expecting. > [ ] allow <on-exception>s common to all components Yes please > [ ] add new <on-new-session> element - allowing 'show-url' redirect > (ensure $SERVLET, $URL and $REQUEST are set before processing it!) Yes please > [ ] implement <pre-condition>s - example: yes please, although personally I would still prefer a way of defining separate actions for get/post and secure/insecure as I think these are so common and using preconditions will make the actionservlet seem more complicated. > [ ] allow evaluation of 'show-url' directly, not only via > <output-variable> yes please > [ ] put $REQUEST (of type HttpServletRequest) to Context - like $SERVLET yes please, but can we put all these things into a single namespace in the Context for security and lack of potential conflicts. > [ ] examples configuration + out-of-box ant task for Jetty Good. Thanks for all this. We are going well with ActionServlet at the moment with Mandip churning out production quality code nice and quick. Erik has also been working on our generic "framework" for all our projects using ActionServlet, Velocity, Jrf and a few home grown standards. Regards David PS Sorry for the flood of emails, just trying to clear my desk before holidays. -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. |
From: David W. <da...@su...> - 2002-08-09 22:44:33
|
Petr, Actually, I think you already have this on your 0.94 list as [ ] add new <on-new-session> element - allowing 'show-url' redirect (ensure $SERVLET, $URL and $REQUEST are set before processing it!) David David Warnock wrote: > Petr, > >> I searched mail archive and couldn't find David's "loading values upon a >> new session" - can you remind me what was that? > > > I think Mandip was referring to my email on 17 May "New Session > Behaviour". In that I said > > >>>>>>>>>>>>>>>>>> > Hi, > > We would like to request a new possibility for handling new sessions > > Instead of using the <template name="login.vm" is-new-session="true"> > > We would like a new element immediately after <application> called > <new-session> It would work like this > > <application> > <new-session show-url="/Login" /> > ... > > This would redirect you to the /Login url and thus to the /Login action. > > The main advantages are: > > - the url makes the action much clearer (you are at a /login url) > > - what happens on a first connection is much clearer > > > I am quite happy to also allow > > <application> > <new-session show-template="Login.vm" /> > ... > > if people want this. > > Thanks > > David > <<<<<<<<<<<<<<<< -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. |
From: David W. <da...@su...> - 2002-08-09 22:31:16
|
Petr, > I searched mail archive and couldn't find David's "loading values upon a > new session" - can you remind me what was that? I think Mandip was referring to my email on 17 May "New Session Behaviour". In that I said >>>>>>>>>>>>>>>>>> Hi, We would like to request a new possibility for handling new sessions Instead of using the <template name="login.vm" is-new-session="true"> We would like a new element immediately after <application> called <new-session> It would work like this <application> <new-session show-url="/Login" /> ... This would redirect you to the /Login url and thus to the /Login action. The main advantages are: - the url makes the action much clearer (you are at a /login url) - what happens on a first connection is much clearer I am quite happy to also allow <application> <new-session show-template="Login.vm" /> ... if people want this. Thanks David <<<<<<<<<<<<<<<< -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. |
From: David W. <da...@su...> - 2002-08-09 22:25:49
|
Petr Toman wrote: > Of course, if there is a demand, <output-variable>s could be allowed > also after <invoke>s... your opinions, gentlemen? :) I think the sequential option is more readable than the nested. ie I prefer <template xxx> <invoke xxx/> <output-variable xxx/> </template> instead of <template xxx> <invoke xxx> <output-variable xxx/> </invoke> </template> Actually I think that both should be allowed. David -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. |
From: Craig L. <cr...@be...> - 2002-08-09 21:58:35
|
On Fri, 2002-08-09 at 17:06, Mark D. Anderson wrote: > > for my money, i think its cleaner to simply have no order requirement > > for invoke/output-variable elements. >=20 > You mean, as enforced by the dtd? > What does order mean? currently, the dtd forces output-variable elements followed by invoke elements, as such: <!ELEMENT template (output-variable*, invoke*)> so you can't have: <template xxx> <invoke xxx/> <output-variable xxx/> </template> that's what i mean by order. i'm saying that i don't think it makes sense to force it to be in that order. petr indicated that i could do it like this: <template xxx> <invoke xxx> <output-variable xxx/> </invoke> </template> to achieve the same effect, having the invoke element processed before the output-variable one. my comment is i don't like that as much as the first example, i think one should be allowed to mix output-variable and invoke elements. > Is the declaration order in xml supposed to support dependencies in > expressions on variables declared earlier? i'm not exactly sure of what you mean by 'support dependencies'. i do think that the order in which elements appear inside another element is important. if i have: <template xxx> <invoke name=3D"x1" xxx/> <invoke name=3D"x2" xxx/> <invoke name=3D"x3" xxx/> </template> i expect x1 to be evaluated, then x2 and finally x3, likewise i mixed invoke and output-variable elements, i would expect those to be evaluated in order of appearance to. however, if i screwed up in the previous example and made the x1 invoke use a variable named x3 in its method call, i wouldn't expect the xml parser/actionservlet to fix that for me, that's my fault. make sense? --=20 CraigL->Thx(); Be Developer ID: 5852 |
From: Mark D. A. <md...@di...> - 2002-08-09 21:06:13
|
> for my money, i think its cleaner to simply have no order requirement > for invoke/output-variable elements. You mean, as enforced by the dtd? What does order mean? Is the declaration order in xml supposed to support dependencies in expressions on variables declared earlier? -mda |
From: Craig L. <cr...@be...> - 2002-08-09 19:46:27
|
On Fri, 2002-08-09 at 14:50, Petr Toman wrote: > The reason why <template>'s <output-variable>s are placed before > <invoke> is that you can nest another set of <output-variables>s inside > <invoke> (and override values or whatever): >=20 > <template name=3D"/displayObject.vm"> > <invoke component=3D"session" > method=3D"storeSession(Context context, Object $typeID)"> > <output-variable name=3D"objectList" component=3D"objectManager" > value=3D"getDefaultList($typeID)"/> > <invoke> > </template> >=20 > In addition, <invoke> behaves almost exactly as <action> and may also > retrieve values from request (or set them by <input-variable>). Does > this satisfy your requirements? it does technically satisfy what i wanted, yes. however, it doesn't 'sit' right with me. the output-variable and the invoke elements are not related in any way, shape or form, so it didn't make sense to me to nest it like that. if the output-variable depended on something the invoke set up, then i guess it does. now, i understand that technically its not relevant, the stuff done by output-variable in the above case would still be available to the template when it finally runs, but it just seems to me that it is a more semantically correct to be able to put the invoke by itself before the output-variable, if the two are not related or dependent on each other. too picky? for my money, i think its cleaner to simply have no order requirement for invoke/output-variable elements. now, on to a bit of a possible bug. i've actually gone ahead and done some test coding to allow invoke elements before and after the output-variable elements in a template (and processed in that order), and part of what i was doing i initially tried to use input-variable elements to set some variables from the request, but it seemed to me that they were never actually executed. i saw this: when a _template_ has a 'subaction' (invoke for eg), the ActionServlet calls the static Action.handleTemplate() method, which simply calls the invoke() method directly on the subaction, which does no input-variable processing at all (afaict). when a normal action is processed, via the Action.reinvoke() method (which is, in turn, called by Action.invoke() ), it use the Action.invokeSubAction() method, which clearly does handle the input variables. everything seems to allow the input-variable element inside an invoke element, the tutorial even uses it. but my basic testing didn't work, and if i look closely at the tutorial, although i suspect there was a loophole in the tutorial example (the on-return and the input-variable both named the variable 'result'). i'm not convinced that i didn't have something else wrong that was causing problems, but i did notice this while going through the code and would appreciate some one explaining where i'm wrong, or not. once i get my other testing doen, i'm going to explore this more closely also and maybe i'll notice what i'm missing. cheers, --=20 CraigL->Thx(); Be Developer ID: 5852 |