nestedaction.java

来自「在Struts2中的jar包xwork的源代码.版本为2.0.7」· Java 代码 · 共 58 行

JAVA
58
字号
/* * Copyright (c) 2002-2003 by OpenSymphony * All rights reserved. */package com.opensymphony.xwork2;import com.opensymphony.xwork2.util.ValueStack;import junit.framework.Assert;/** * NestedAction * * @author Jason Carreira *         Created Mar 5, 2003 3:08:19 PM */public class NestedAction implements Action {    private String nestedProperty = ActionNestingTest.NESTED_VALUE;    public NestedAction() {    }    public String getNestedProperty() {        return nestedProperty;    }    public String execute() throws Exception {        Assert.fail();        return null;    }    public String noStack() {        ValueStack stack = ActionContext.getContext().getValueStack();        // Action + DefaultTextProvider on the stack        Assert.assertEquals(2, stack.size());        Assert.assertNull(stack.findValue(ActionNestingTest.KEY));        Assert.assertEquals(ActionNestingTest.NESTED_VALUE, stack.findValue(ActionNestingTest.NESTED_KEY));        return SUCCESS;    }    public String stack() {        ValueStack stack = ActionContext.getContext().getValueStack();        //DefaultTextProvider, NestedActionTest pushed on by the test, and the NestedAction        Assert.assertEquals(3, stack.size());        Assert.assertNotNull(stack.findValue(ActionNestingTest.KEY));        Assert.assertEquals(ActionContext.getContext().getValueStack().findValue(ActionNestingTest.KEY), ActionNestingTest.VALUE);        Assert.assertEquals(ActionNestingTest.NESTED_VALUE, stack.findValue(ActionNestingTest.NESTED_KEY));        return SUCCESS;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?