2011-09-27 226 views
2

昨天,當我試圖從行動中獲得一個變量值時,如果我將定義在ftl值中的變量設置爲10以下,結果總是爲空。如何在freemarker模板中使用Integer?

<input type="hidden" name="orderId" id=orderId" value="9" /> 

public class OrderVo { 
    private Long id; 
    public Long getId() { return this.id; } 
    public void setId(Long id) { this.id = id; } 
} 

System.out.println("=============================" +vo.getOrderId()); 

the result was "" 

謝謝你在第一,但它不工作。 前天我收到了! 因爲發佈了tomcat。 您可能會遇到tomcat 6.x中的問題,但不是5.x.

+0

您需要提供更多信息。缺少報價是否有錯字?你是說你*輸入* 10,還是將該值設置爲10,並希望它出現在模板中? –

回答