I am not sure but beans typically use instances, one of the contracts for a javabean
is that it has a no-argument constructor. statics should always be avoided. almost
100% of the time.
ian
u, Nov 20, 2003 at 05:40:34PM +0200, Taavi Tiirik wrote:
>
> I am about to use this #bean macro and am wondering if
> this is a proper way of doing it?
>
> My .vm page contains:
>
> #bean( "util.Html" $html )
> $html.escape( "This text will <b>end up escaped</b>." )
>
> and my Html helper bean is like this:
>
> public class Html
> {
> public static String escape( String s )
> {
> // method that returns escaped version of parameter s
> return ...;
> }
> }
>
> And speaking of escaping html with velocity... do you know
> if there is an existing/better way of doing it?
>
> with best wishes,
> taavi.
>
>
> > > What does this buy you that the #bean macro doesn't?
> >
> > I didn't even realize there was a #bean macro :) And I agree. I do
> > think the #bean works better. I'll leave in the ability to chain the
> > WebWorkVelocityContext and remove ToolContext from source tree.
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork