You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Todd Trimmer <ba...@gte.net> on 2002/12/28 06:56:33 UTC

[jelly] custom variables

Is there a way to get a JellyContext into a doTag() method? So we can set variables that exist in the scope of that tag? It might be kind of dangerous to allow the whole JellyContext in there, so what about a JellyContextProxy that only gives access to getVariable(String) and setVariable(String, Object) ?


Todd Trimmer

Re: [jelly] custom variables

Posted by Paul Libbrecht <pa...@activemath.org>.
On Dimanche, déce 29, 2002, at 01:16 Europe/Brussels, Todd Trimmer 
wrote:
>>> Is there a way to get a JellyContext into a doTag() method
>> But there is !
>> TagSupport.getContext(), absolutely no proxying whatsoever.
>
> Perfect! Whenever I saw "TagSupport" in the docs, I kept erroneously
> assuming this meant javax.servlet.jsp.tagext.TagSupport. My mistake.

Ooooh, indeed.
I think Jelly is trying to provide most of what JSP can do but does not 
use any of it. It is kind of mentionned in some of the documentation, I 
think.

I you happen to use to Jelly within servlets, you might want to think 
about submitting your code, I think several people developing jelly 
would have interest into an implementation similar to the JSP servlet.

Paul


Re: [jelly] custom variables

Posted by Todd Trimmer <ba...@gte.net>.
>> Is there a way to get a JellyContext into a doTag() method

> But there is !
> TagSupport.getContext(), absolutely no proxying whatsoever.


Perfect! Whenever I saw "TagSupport" in the docs, I kept erroneously
assuming this meant javax.servlet.jsp.tagext.TagSupport. My mistake.

Thanks,
Todd Trimmer


Re: [jelly] custom variables

Posted by Paul Libbrecht <pa...@activemath.org>.
On Samedi, déce 28, 2002, at 06:56 Europe/Brussels, Todd Trimmer wrote:
> Is there a way to get a JellyContext into a doTag() method? So we can 
> set variables that exist in the scope of that tag? It might be kind of 
> dangerous to allow the whole JellyContext in there, so what about a 
> JellyContextProxy that only gives access to getVariable(String) and 
> setVariable(String, Object)?

But there is !
TagSupport.getContext(), absolutely no proxying whatsoever.
I am not sure why you would want to prevent access to the whole 
context. At least such things as access to the URL, class-loader, and 
tag-library definitions are things you want to offer to most tags.

Paul


Re: [jelly] custom variables

Posted by di...@multitask.com.au.
Sure.

Create your own JellyContext in doTag and pass it the current context as 
the parent.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


"Todd Trimmer" <ba...@gte.net> wrote on 28/12/2002 04:56:33 PM:

> Is there a way to get a JellyContext into a doTag() method? So we 
> can set variables that exist in the scope of that tag? It might be 
> kind of dangerous to allow the whole JellyContext in there, so what 
> about a JellyContextProxy that only gives access to 
> getVariable(String) and setVariable(String, Object) ?
> 
> 
> Todd Trimmer

> ForwardSourceID:NT0009C1E2