Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
User我将一个类型的变量(由我创建)传递给 Apache Velocity 模板。User有方法getUsername(),在速度模板中我使用它如下:
User
getUsername()
#if($user) <p> User Created $user.getUsername() </p> #end
但输出与预期User Created $user.getUsername()不符;User Created Pluto为什么??你能帮助我吗??
User Created $user.getUsername()
User Created Pluto
这意味着 getUsername() 方法返回的值为 null,或者该方法可能不存在。