ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 代码 session: ~~~ public class HelloAction extends ActionSupport { public String index() { ActionContext context = ActionContext.getContext(); Map<String, Object> session = context.getSession(); session.put("name", "jack"); return SUCCESS; } } ~~~ <s:property value="#session.name"></s:property> ~~~ application: ~~~ ActionContext context = ActionContext.getContext(); Map<String, Object> application = context.getApplication(); application.put("name", "jack"); return SUCCESS; ~~~ <s:property value="#application.name"></s:property> <s:property value="#attr.name"></s:property> //使用attr也能获取到 ~~~ 使用自定义key: ~~~ ActionContext context = ActionContext.getContext(); context.put("name","jack"); return SUCCESS; ~~~ ~~~ <s:property value="#name"></s:property> ~~~