package com.haiyisoft.hyscm.mdm.action;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@Namespace("/mdm")
@ParentPackage("framework-default")
@Action(value="mdmTest",results = {@Result(name = "success", type="json") })
public class MdmTestAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String companyId;
public String execute(){
return outPutString(companyId);
}
public String outPutString(String param){
PrintWriter writer = null;
try {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("application/json;charset=utf-8");
writer = response.getWriter();
response.setDateHeader("Expires", 0);
writer.write(param);
writer.flush();
} catch (Exception e) {
}finally{
if(writer!=null){
writer.close();
}
}
return null;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}