[Velocity Wiki] Update of VelocityEditors by ByronFoster
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 ByronFoster: http://wiki.apache.org/velocity/VelocityEditors -- === Eclipse === + + Veloeclipse is a Velocity editor, based on Veloedit, which also provides smart editing of XML and HTML files. [http://propsorter.sourceforge.net/veloeclipse/] + JointLogic provides [http://www.jointlogic.com/webdesigner/ Web Designer plug-in] that allows WYSIWYG authoring of HTML and XHTML documents and fragments with embedded Velocity template language elements. Joe Hudson ([EMAIL PROTECTED]) has created a [http://velocitywebedit.sourceforge.net plug-in] for editing templates with the [http://www.eclipse.org/ Eclipse] IDE. Features include: content assist (Velocity directives, variables, macros, javascript, HTML, java context objects), outline view (HTML Directive) and syntax highlighting. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6.1 Reporter: Byron Foster The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Updated: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Byron Foster updated VELOCITY-656: -- Attachment: 656.patch Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6.1 Reporter: Byron Foster Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Commented: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12655283#action_12655283 ] Nathan Bubna commented on VELOCITY-656: --- It's common Java practice that toString() should never return null or throw an exception. It is pretty rare that any software is prepared to handle either possibility. Velocity, however, has always been fine with returning null in toString() and never complained about such behavior. The Alternator class from VelocityTools even relies on this to alternate over sets including null values. I personally have used this often in my own development. The change to #if to test for toString() == null is to ensure that #if works with this paradigm. I'm not inclined to rebuild 1.6.1 again for this, and i'm hesitant about it in general. To me, an exception during a toString() call is a big no-no on the user's part. The stack trace they get should point them to the toString() call, which i think ought to be the thing they focus on fixing. The template/line/col of the guilty VTL reference might be helpful to log, but their problem is in Java, not their totally valid VTL. Wrapping the root exception in a VelocityException feels like it draws attention to the wrong code location. Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6.1 Reporter: Byron Foster Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Commented: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12655308#action_12655308 ] Byron Foster commented on VELOCITY-656: --- This issue came up when referring to a Hibernate object wrapped with a proxy object which is a standard pattern that Hibernate uses for working with POJOs. If any methods are called on the proxy outside of the originating Hibernate session, then Hibernate throws the dreaded LazyIntializationException, this includes the toString() method. The stack trace in this case is deep within Hibernate. I guess I have two points, the first is that I think that Velocity should always report accurately where in a template a problem has occurred. The second, as far as I know, currently any error encountered while processing a template generates some sort of velocity exception, and the location of the problem within the template file is reported in the exception message. This patch was attempting to be consistent with that trend. My only concern with calling toString() is that on some object this may be non-trivial, and may be surprising behavior from #if($foo). But, it's probably not a big deal. Let me know if you think another approach would be better, and I'll provide a new patch. I don't think this has a high priority which is why I marked it as an improvement, so I don't think it's necessary for 1.6.1. Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6.1 Reporter: Byron Foster Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Commented: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12655313#action_12655313 ] Nathan Bubna commented on VELOCITY-656: --- If it won't bother you to leave this out of 1.6.1, that's great, i'm rather weary of rebuilding it. Dropping Hibernate objects in the context is always scary, but i can't deny having done it myself. I still think it's terribly wrong that toString() ever throws an exception. My feeling was that logging this was better than wrapping it, but it's more of a -0 feeling than a -1 feeling. Let's leave this for 1.7. And i'll probably just let you commit it once we get your account set up (hopefully not too much longer). Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6.1 Reporter: Byron Foster Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Updated: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nathan Bubna updated VELOCITY-656: -- Affects Version/s: 1.7 1.6 Fix Version/s: 1.7 Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6, 1.6.1, 1.7 Reporter: Byron Foster Fix For: 1.7 Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]
[jira] Commented: (VELOCITY-656) Wrap ref evaluate exception so vm location is revealed
[ https://issues.apache.org/jira/browse/VELOCITY-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12655536#action_12655536 ] Claude Brisson commented on VELOCITY-656: - You might just drop Hibernate itself... ;-) Wrap ref evaluate exception so vm location is revealed -- Key: VELOCITY-656 URL: https://issues.apache.org/jira/browse/VELOCITY-656 Project: Velocity Issue Type: Improvement Affects Versions: 1.6, 1.6.1, 1.7 Reporter: Byron Foster Fix For: 1.7 Attachments: 656.patch The following VTL calls the toString() method on the object in $foo: #if($foo)#end If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference. However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing? -- 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]