Kees Jongenburger <[EMAIL PROTECTED]> wrote: > > This will not solve imnput problems. Imagine that the functiona ctually has > > two arguments: > > > > <mm:function name="url"> > > <mm:param name="type" value="ram" /> > > <mm:param name="connection" value="1500" /> > > </mm:function> > > > > could perhaps send url(ram,1500) to the core. > > > > But what should > > > > <mm:function name="url"> > > <mm:param name="connection" value="1500" /> > > <mm:param name="type" value="ram" /> > > </mm:function> > > > > do then? > > hmm named parameters is very nice in perl > call ( -url -> "http://www.test.nl/" ,-connectionspeed =>"84kbs"); > > But I think the "java" way of doing this is just like beans are doing it > <jsp:useBean id="search" class="org.mmbase.applications.htdigsearch.HTDigBean" > scope="page"/> > <jsp:setProperty name="search" property="*" /> > or > <jsp:setProperty name="search" property="ram" />
(it think the property 'ram' is ill chosen because in my example 'ram' was the value, not the 'name' of the parameters) > <jsp:getProperty name="search" property="result" /> This seems also a way to make 'named' parameters, only using beans (which makes it all a bit odd..) This example will use the 'request' object, so an mm:function version of this will need to now that the function 'result' needs a request. You will also have to define somehere which bean-properties are relevant for the get you want to do. So, it would be completely possible to implemetn a 'set' function based on beans: <mm:function set="search" name="result" /> which is considerably more verbose than your example :-) 'request' would in taglib be an example of an automaticly filled parameter. It will simply check if the 'result' functions needs a 'request' object and if so, it will be set. The function implementation itself can than also set the 'type' property based on the request (because it knows that the 'result' function can use the 'type' property). A bit less verbose implemntation (without the automatic use of the request object) would be possible too: <mm:import externid="type" from="parameters,cookie" /> <mm:function set="search" name="result" referids="type" /> We did not concentrate on 'bean-based' implemetnation but it would be perfectly possible, but for the front-end implementor it would make no difference. Michiel -- Michiel Meeuwissen Mediapark C101 Hilversum +31 (0)35 6772979 nl_NL eo_XX en_US mihxil' [] ()
