struts2——jsp 获取 action 值

在你的action类中。定义一个str,并加上get set 方法。只要你在action中设置了str的值。request范围内就可以获取。

比如

public class TestAction extends ActionSupport {

private String str;
//省略getter setter

public String execute() {
str = "123";
return SUCCESS;
}
}


页面直接用 {str}

猜你喜欢

转载自moocherman.iteye.com/blog/1702683