steven
级别: 总版主
只看楼主 | | | 0 发表于:2009-01-21 14:24

0 Struts2中遇到FreeMarker template error!怎么办?

    当你在使用Struts2框架的时候,在某些情况下会遇到类似如下提示的错误:


   1. FreeMarker template error!  
   2. Expression error is undefined on line 35, column 4 in template/simple/actionerror.ftl.  
   3. The problematic instruction:  
   4. ----------  
   5. ==> ${error} [on line 35, column 2 in template/simple/actionerror.ftl]  
   6. ----------  

FreeMarker template error! Expression error is undefined on line 35, column 4 in template/simple/actionerror.ftl. The problematic instruction: ---------- ==> ${error} [on line 35, column 2 in template/simple/actionerror.ftl] ----------

    此时往往很难判断问题发生在哪里,因为这里的信息提示不明确,这里给大家一个经验:这种问题的引起往往是你在action中使用了 addActionError这样的方法在汇报actionerror,而你在调用addActionError方法时传入了null值,这时候机会导致这样的问题发生,所以如果发生这样的情况请检查你的代码,看看是否因为某种问题导致给addActionError方法传入了null值,找到了解决这个问题就可以了。

    祝你成功!
知识共享,共同进步。