Announcement Announcement Module
Collapse
No announcement yet.
Velocity error with latest #springBind macro Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Velocity error with latest #springBind macro

    Using a nightly build from August 11th, the #springBind($path) velocity macro works fine. Here's what I have in my form.

    Code:
    <form method="post" action="editUser.html">
    #springBind&#40;"user.id"&#41;
    <input type="hidden" name="id" value="$!&#123;status.value&#125;"/>
    <table>
    However, when I upgraded to CVS tonight, I started getting the following error:

    Code:
    ERROR - CommonsLoggingLogSystem.logVelocityMessage&#40;42&#41; | Left side &#40;$springHtmlEscape&#41; of '==' opera
    tion has null value. If a reference, it may not be in the context. Operation not possible. /WEB-INF/
    velocity/userForm.vm &#91;line 1, column 62&#93;
    On 8-11, the macro was:

    Code:
    #macro&#40; springBind $path &#41;
    	#set &#40;$status = $springMacroRequestContext.getBindStatus&#40;$path&#41;&#41;
    #end
    And now its:

    Code:
    #macro&#40; springBind $path &#41;
    	#if&#40;$springHtmlEscape == true || $springHtmlEscape == false&#41;
    		#set&#40; $status = $springMacroRequestContext.getBindStatus&#40;$path, $springHtmlEscape&#41; &#41;
    	#else
    		#set&#40; $status = $springMacroRequestContext.getBindStatus&#40;$path&#41; &#41;
    	#end
    #end
    Maybe it should simply be changed to the following:

    Code:
    #macro&#40; springBind $path &#41;
    	#if&#40;$springHtmlEscape&#41;
    		#set&#40; $status = $springMacroRequestContext.getBindStatus&#40;$path, $springHtmlEscape&#41; &#41;
    	#else
    		#set&#40; $status = $springMacroRequestContext.getBindStatus&#40;$path&#41; &#41;
    	#end
    #end
    This seems to fix the problem.

  • #2
    This error crept in just before RC2 was released - I thought I'd fixed it along with some other changes that were committed a couple of days ago but it looks like a copy/paste error on my part left it as was. The correct version is now committed.

    Comment

    Working...
    X