我在action设置了
request.setAttribute("str", "aaaaa");
但是在页面通过 $str 取不到值假如把str 添加get set属性 在页面 $str 就可以取到值了请问要怎么设置下 request.setAttribute才有效?velocitystruts2
request.setAttribute("str", "aaaaa");
但是在页面通过 $str 取不到值假如把str 添加get set属性 在页面 $str 就可以取到值了请问要怎么设置下 request.setAttribute才有效?velocitystruts2
取:request.getAttribute("name");
注意作用域
我的是Velocity 想要页面直接通过$符来取值
要怎么做啊
context.put("str","aaaaa");
velocity模板中这样写:<div>${str}</div>