我想将我的操作中的值传递到Google应用程序引擎中的结果jsp文件。 用于 java 和 strut2 2.1.8.1 的谷歌应用引擎 1.4.3
按照http://programmingpanda.blogspot.com/2009/07/struts-2-ongl-issue-on-google-app.html的指令我已经修复了ongl监听器。
在我的行动中:
public String execute()
{
ActionContext.getContext().getValueStack().set("user", "LovelyCat");
return "success";
}
结果页面是这个jsp页面,我尝试在其中获取“用户”:
<%
String name = (String)ActionContext.getContext().getValueStack().findValue( "user" );
out.write(name);
%>
但 name 为 null 并且不打印任何内容。 各位,请帮助我。
最佳答案
使用这个
public String execute() {
ActionContext.getContext().put("user", "LovelyCat");
return SUCCESS;
}
.jsp
<s:property value="user" />
或更优化
${user}
关于java - 如何在谷歌应用程序引擎中将值从action传递到jsp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6303834/