Re: [OS-webwork] velocity tool support
Hmm, it seems that $!webwork.htmlEncode() is doing exactly what I was looking for. taavi. > 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 end up escaped." ) > > 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? --- 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
Re: [OS-webwork] velocity tool support
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 end up escaped." ) > > 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
Re: [OS-webwork] velocity tool support
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 end up escaped." ) 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
Re: [OS-webwork] velocity tool support
Rickard Öberg wrote: Matt Ho wrote: I've opted to move this to the webwork extensions rather than have it part of the webwork core. Although the VelocityServlet will be deprecated, that won't be til Velocity 1.5! One of the features that's extremely appealing about the velocity tool project is the ability to easily add your own helpers to the velocity context. To that end, I've added a ToolContext (similar to velocity tools ToolboxContext) that allows you to add objects to the velocity context. 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. M --- 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
Re: [OS-webwork] velocity tool support
I agree, and having just refactored these bits in ww1 I think that adding all this velocity config stuff to webwork is duplication and unnecessary. The jsp equivalent for example would be to suddenly allow for the ability to define various scoped objects in the webwork config. Use a startup listener instead, or subclass the appropriate class that creates the velocity context and puts in your custom stuff. On Nov 18, 2003, at 6:18 AM, Rickard Öberg wrote: Matt Ho wrote: I've opted to move this to the webwork extensions rather than have it part of the webwork core. Although the VelocityServlet will be deprecated, that won't be til Velocity 1.5! One of the features that's extremely appealing about the velocity tool project is the ability to easily add your own helpers to the velocity context. To that end, I've added a ToolContext (similar to velocity tools ToolboxContext) that allows you to add objects to the velocity context. What does this buy you that the #bean macro doesn't? The problem with this proposal, as I see it, is that they will always be instantiated, even if they're not used. By using #bean macro only those tools that are actually used will be created. IMO that's better. /Rickard --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/ g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
RE: [OS-webwork] velocity tool support
Is this then to the point of actually being usable? I have exactly this requirement and i'd like to use this. Or, is this going to be part of the WW2 next release? Eric > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Jonas Eriksson > Sent: Tuesday, November 18, 2003 11:42 AM > To: [EMAIL PROTECTED] > Subject: Re: [OS-webwork] velocity tool support > > > I totally agree about putting it in webwork extensions! > > Jonas > > > Matt Ho wrote: > > I've opted to move this to the webwork extensions rather > than have it > > part of the webwork core. Although the VelocityServlet will be > > deprecated, that won't be til Velocity 1.5! > > > > One of the features that's extremely appealing about the > velocity tool > > project is the ability to easily add your own helpers to > the velocity > > context. To that end, I've added a ToolContext (similar to > velocity > > tools ToolboxContext) that allows you to add objects to the > velocity > > context. > > > > Finally, to enable this, I added support for chaining additional > > VelocityContexts to the end of the WebWorkVelocityContext. > > > > Here's a snippet from webwork.properties > > > > > > # > > # Allow user defined VelocityContexts to be chained to the end of > > # the WebWorkVelocityContext > > # > > > webwork.velocity.contexts=com.opensymphony.webwork.views.veloc > ity.ToolContext > > > > > > # > > # Allow users to place objects into the VelocityContext. > For example, > > # the following snippet would place 3 objects in the > VelocityContext; > > # $name1, $name2, and $name3 that would be references to > instances of > > # $classname1, $classname2, and $classname3 respectively. if > > # the classname value is not a class, then the value will > resolve to a > > # string. For example, $name4 would resolve to 'hello world' > > # > > #webwork.velocity.tool.name1 = classname1 > > #webwork.velocity.tool.name2 = classname2 > > #webwork.velocity.tool.name3 = classname3 > > #webwork.velocity.tool.name4 = hello world > > > > M > > > > > > > > --- > > This SF. Net email is sponsored by: GoToMyPC > > GoToMyPC is the fast, easy and secure way to access your > computer from > > any Web browser or wireless device. Click here to Try it Free! > > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > ___ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] velocity tool support
Matt Ho wrote: I've opted to move this to the webwork extensions rather than have it part of the webwork core. Although the VelocityServlet will be deprecated, that won't be til Velocity 1.5! One of the features that's extremely appealing about the velocity tool project is the ability to easily add your own helpers to the velocity context. To that end, I've added a ToolContext (similar to velocity tools ToolboxContext) that allows you to add objects to the velocity context. What does this buy you that the #bean macro doesn't? The problem with this proposal, as I see it, is that they will always be instantiated, even if they're not used. By using #bean macro only those tools that are actually used will be created. IMO that's better. /Rickard --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] velocity tool support
I totally agree about putting it in webwork extensions! Jonas Matt Ho wrote: I've opted to move this to the webwork extensions rather than have it part of the webwork core. Although the VelocityServlet will be deprecated, that won't be til Velocity 1.5! One of the features that's extremely appealing about the velocity tool project is the ability to easily add your own helpers to the velocity context. To that end, I've added a ToolContext (similar to velocity tools ToolboxContext) that allows you to add objects to the velocity context. Finally, to enable this, I added support for chaining additional VelocityContexts to the end of the WebWorkVelocityContext. Here's a snippet from webwork.properties # # Allow user defined VelocityContexts to be chained to the end of # the WebWorkVelocityContext # webwork.velocity.contexts=com.opensymphony.webwork.views.velocity.ToolContext # # Allow users to place objects into the VelocityContext. For example, # the following snippet would place 3 objects in the VelocityContext; # $name1, $name2, and $name3 that would be references to instances of # $classname1, $classname2, and $classname3 respectively. if # the classname value is not a class, then the value will resolve to a # string. For example, $name4 would resolve to 'hello world' # #webwork.velocity.tool.name1 = classname1 #webwork.velocity.tool.name2 = classname2 #webwork.velocity.tool.name3 = classname3 #webwork.velocity.tool.name4 = hello world M --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
[OS-webwork] velocity tool support
I've opted to move this to the webwork extensions rather than have it part of the webwork core. Although the VelocityServlet will be deprecated, that won't be til Velocity 1.5! One of the features that's extremely appealing about the velocity tool project is the ability to easily add your own helpers to the velocity context. To that end, I've added a ToolContext (similar to velocity tools ToolboxContext) that allows you to add objects to the velocity context. Finally, to enable this, I added support for chaining additional VelocityContexts to the end of the WebWorkVelocityContext. Here's a snippet from webwork.properties # # Allow user defined VelocityContexts to be chained to the end of # the WebWorkVelocityContext # webwork.velocity.contexts=com.opensymphony.webwork.views.velocity.ToolContext # # Allow users to place objects into the VelocityContext. For example, # the following snippet would place 3 objects in the VelocityContext; # $name1, $name2, and $name3 that would be references to instances of # $classname1, $classname2, and $classname3 respectively. if # the classname value is not a class, then the value will resolve to a # string. For example, $name4 would resolve to 'hello world' # #webwork.velocity.tool.name1 = classname1 #webwork.velocity.tool.name2 = classname2 #webwork.velocity.tool.name3 = classname3 #webwork.velocity.tool.name4 = hello world M --- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork