Saturday, June 15, 2013

Struts 2 FreeMarker Template Error

freemarker.core.InvalidReferenceException: Error on line 69, column 13 in template/simple/select.ftl stack.findValue('top') is undefined. It cannot be assigned to itemKey

Why This error Occured

Case 1

It generally occurs if you populating the java.util.list that use used to populate structs 2 tags from data base or any dynamic content source.

How to trouble shoot

I f you are using databse to populate select list go back and chick you data base.
it is better to write an if statement to to incepct the value is not null before adding to list.

if(something!=null)
{
list.add(something);
}


3 comments:

  1. I wasted 1 day for this error.Good solution

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. Thank for your answer.You saved my time

    ReplyDelete