You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Jon Scott Stevens <jo...@latchkey.com> on 2002/03/28 01:57:25 UTC

Another 1.4 bug..

This is some scarab code...it *used* to work fine...

#macro (numericSelect $name $first $last $selected $size)
<select name="$name" size="$size">
#foreach ($i in [$first..$last])
<option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>
#end
</select>
#end

  <td>#numericSelect($rmitGroup.Order.Key 1 5 $rmit.Order 1)</td>

Produces this stack trace (sorry, no line numbers for some reason)...

  java.lang.Error: Missing return statement in function
    at org.apache.velocity.runtime.parser.Parser.DirectiveArg(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.Directive(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.ElseStatement(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.IfStatement(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.process(Parser.java)
    at org.apache.velocity.runtime.parser.Parser.parse(Parser.java)
    at 
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java)
    at 
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java)
    at org.apache.velocity.Template.process(Template.java)
    at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(Resour
ceManagerImpl.java)
    at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Resourc
eManagerImpl.java)
    at 
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java
)
    at 
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.ja
va)
    at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java)
    at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java)
    at 
org.apache.fulcrum.velocity.TurbineVelocityService.handleRequest(TurbineVelo
cityService.java:292)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Another 1.4 bug..

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/27/02 7:57 PM, "Jon Scott Stevens" <jo...@latchkey.com> wrote:

> This is some scarab code...it *used* to work fine...
> 
> #macro (numericSelect $name $first $last $selected $size)
> <select name="$name" size="$size">
> #foreach ($i in [$first..$last])
> <option value="$i" #if ($i==$selected)selected="selected" #end>$i</option>
> #end
> </select>
> #end
> 
> <td>#numericSelect($rmitGroup.Order.Key 1 5 $rmit.Order 1)</td>
> 
> Produces this stack trace (sorry, no line numbers for some reason)...
> 
> java.lang.Error: Missing return statement in function


Are you 100% sure that you updated and rebuilt your vel jar?  This works
fine on my machine.  I am sure I fixed it, and I just verified the source is
in CVS. I just downloaded a fresh source tree, built and tested, and all is
well with the above...

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>