postparamsaction.java

来自「这是一个crm系统的源码」· Java 代码 · 共 62 行

JAVA
62
字号
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 + =
减小字号Ctrl + -
显示快捷键?