struts 页面取值问题

    xiaoxiao2026-06-19  10

    Struts2中的OGNL表达式语言是对XworkOGNL的封装。我们要理解一下几点:  1 Struts2 中将 ActionContext 作为 OGNL 的上下文环境( ActionContext 内部含有一个 Map 对象)   2 Struts2 中的 OGNL 表达式语言的根对象是一个 ValueStack ValueStack 中的每一个对象都被视为根对象,根对象访问不用加 #   Struts2 框架将实例化的 Action 对象放入 ValueStack 中,如果是 Action 链,则多个 Action 都存在于 ValueStack 中。而 ValueStack 中除了 Action 外, Struts2 框架还将 parameters request response session application attr 等对象放到 ActionContext 中,访问这些对象需要加前缀 # 获取map值

    最新回复(0)