[jira] Commented: (VELOCITY-519) Java escape sequences should work in Velocity macros

2007-02-25 Thread Christopher Schultz (JIRA)

[ 
https://issues.apache.org/jira/browse/VELOCITY-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475718
 ] 

Christopher Schultz commented on VELOCITY-519:
--

If \u syntax works, then it's still possible to insert newlines (\u000a and 
\u000c) and tabs (\u0009), even if the escape sequences aren't as recognizable.

Another option would be to fix bug VELOCITY-520 such that \u escapes do not 
cause an error any longer, and then create a macro that takes a string and 
converts \u and \r, \n, \t, etc. escape sequences into their actual characters.


 Java escape sequences should work in Velocity macros
 

 Key: VELOCITY-519
 URL: https://issues.apache.org/jira/browse/VELOCITY-519
 Project: Velocity
  Issue Type: New Feature
Affects Versions: 1.5 beta2
Reporter: Stepan Koltsov
 Fix For: 1.6

 Attachments: velocity-unescape-2007-02-24-stepancheg.diff, 
 velocity-unescape-only-u-2007-02-24-stepancheg.diff


 Following test should work:
 ===
 public void testJavaEscape() throws Exception {
 VelocityEngine ve = new VelocityEngine();
 ve.init();
 Context context = new VelocityContext();
 StringWriter writer = new StringWriter();
 ve.evaluate(context, writer, test,#set($v = \\\u0061\)$v);
 assertEquals(a, writer.toString());
 writer = new StringWriter();
 ve.evaluate(context, writer, test,#set($v = \\\n\)$v);
 assertEquals(\n, writer.toString());
 }
 ===

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Tools] Some proposals for Tools 2.0

2007-02-25 Thread Claude Brisson
Hi there!

Here are some structural evolutions I'd like to discuss before any
coding. I'm pretty sure that the first one is a good option - the second
one is more prospective.

1. On-demand tools loading: instead of a standard HashMap, the idea here
is to have a ToolMap, inheriting HashMap, which will instanciate a tool
from its toolinfo only when the generic getter is called. This should be
a quite interesting performance gain in some situations. We maybe need
some attribute to have tools instanciated at toolbox initialization
('instanciate-on-load' ?).

2. View tools: other objects in my webapp are often jealous of the view
servlet. They also would like to use some of the tools. Session scoped
tools can be reached via the session, but it's not the case for
application or request scoped tools. To achieve this, there would be two
things to do:
 - the application tools map should be stored as a ServletContext
attribute and the request tools map as a Request attribute.
 - the constitution of the three scoped maps should be decorrelated from
the remaining of the processing so that it could potentially take place
in a servlet filter.

Thanks for your remarks,


  Claude



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Velocity Wiki] Update of ContributedCode by MichaelGuymon

2007-02-25 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Velocity Wiki for 
change notification.

The following page has been changed by MichaelGuymon:
http://wiki.apache.org/velocity/ContributedCode

--
   * MultiUberspect -- an Uberspector that can dispatch introspection tasks to 
custom Uberspectors on a per-class basis
   * LuceneDocumentUberspect -- An Uberspect for Lucene Documents that works 
with the above class
   * JythonUberspect -- An uberspect for handling Jython (Java Python) objects
-  * JRubyUberspect -- An Uberspect for JRuby: 
[http://sprocket.slackworks.com/wiki/show/JRubyUberspect info] 
[http://sprocket.slackworks.com/wiki/show/Slackocity project]
+  * [JRubyUberspect] -- An Uberspect for JRuby: 
[http://sprocket.slackworks.com/wiki/published/JRubyUberspect info] 
[http://sprocket.slackworks.com/wiki/published/Slackocity project]
  
  == Custom Directives ==
   * [XPath] -- XPath evaluating directive, by VladimirKirichenko

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]