📄 postparamsaction.java
字号:
package com.bjsxt.crm.web.struts2.test;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
public class PostParamsAction {
private int intvalue;
private String strvalue;
private int[] intarray;
private boolean boolvalue;
public boolean isBoolvalue() {
return boolvalue;
}
public void setBoolvalue(boolean boolvalue) {
this.boolvalue = boolvalue;
}
public int[] getIntarray() {
return intarray;
}
public void setIntarray(int[] intarray) {
this.intarray = intarray;
}
public int getIntvalue() {
return intvalue;
}
public void setIntvalue(int intvalue) {
this.intvalue = intvalue;
}
public String getStrvalue() {
return strvalue;
}
public void setStrvalue(String strvalue) {
this.strvalue = strvalue;
}
public String input(){
return Action.INPUT;
}
public String save(){
//向JSP页面传递参数
ActionContext.getContext().put("key1", "世界你好");
//往request/session中传参数
ServletActionContext.getRequest().setAttribute("reqParam", "这是requet中的参数");
return Action.SUCCESS;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -