`

ActionContext、ValueStack、Stack Context之间的关系

 
阅读更多

转载自:

http://blog.csdn.net/findsafety/article/details/8676763

分享到:
评论

相关推荐

    JavaEE ActionContext存取数据示例

    ActionContext提供了在Action、Servlet、ValueStack以及其他的Struts2组件之间传递数据的桥梁。在这个“JavaEE ActionContext存取数据示例”中,我们将深入探讨ActionContext的使用方法及其与OGNL(Object-Graph ...

    精讲Struts2

    精简全面讲解Struts 2.0Struts2产生背景 工作原理 实现步骤 标签 命名空间 转换器 国际化 输出 令牌机制 拦截器 表单校验(jQuery.validate验证框架) ...OGNL(ActionContext StackContext ValueStack区别)

    ognl表达式 ognl表达式

    ValueStack stack = context.getValueStack_r(); attribute = stack.findValue(name); } return attribute; // 返回最终找到的属性值 } } ``` #### 六、OGNL表达式在List和Map中的应用 OGNL不仅支持简单的...

    Struts2源码分析之ParametersInterceptor拦截器

    获取到参数后,拦截器会创建一个Map对象(contextMap)来保存ActionContext中的context Map,即OgnlContext对象,然后通过ac.getValueStack()获取ValueStack。ValueStack是OGNL(Object-Graph Navigation Language)...

    struts2框架面试题及答案02

    1. **通过ActionContext**: `ValueStack valueStack = ActionContext.getContext().getValueStack();` 2. **通过ServletActionContext**: `ValueStack valueStack = ServletActionContext.getValueStack...

    Struts2框架基础 二

    ValueStack stack = ActionContext.getContext().getValueStack(); // 将对象压入栈顶 stack.push(new User("John", "Doe")); ``` - **取出数据**: ```java // 从栈顶取出对象 User user = (User) stack....

    马士兵Struts2笔记2013

    Stack Context是ValueStack的一部分,它包含了一些上下文相关的数据,如ActionContext,提供了对请求、响应、session、应用上下文的访问。 11. **Action总结** Action是Struts2的主要业务逻辑载体,它负责处理...

    详解Java的Struts框架中栈值和OGNL的使用

    ValueStack stack = ActionContext.getContext().getValueStack(); Map, Object> context = new HashMap(); context.put("key1", "This is key1"); context.put("key2", "This is key2"); stack.push(context);...

    Struts2在Action中获得Response对象的四种方法

    OgnlValueStack stack = (OgnlValueStack) request.get("struts.valueStack"); HttpServletResponse response = (HttpServletResponse) stack.findValue("response"); // 使用 response 对象 } } ``` 方法 3:...

    struts2自定义编写转换类

    默认情况下,Struts2通过Action上下文(ActionContext)的ValueStack来查找对应的转换器。如果找不到内置的转换器,我们就可以提供自定义的转换器。 自定义转换类需要继承Struts2提供的`org.apache.struts2.util....

Global site tag (gtag.js) - Google Analytics