im new to struts 2 and im asking if there's a way to pass a variable argument into struts 2 annotation.
here is what i already did but with no luck
public class DownloadFileAction extends ModuleGenericClass{
private InputStream inputStream;
private String fileName;
@Action(value="/downloadFile",results={
@Result(name="success",type="stream",params = {
"contentType",
"application/octet-stream",
"inputName","inputStream",
"bufferSize","1024","contentDisposition",
"filename=\"${fileName}\""})
})
public String execute() throws Exception {
fileName = "testing";
inputStream = //myInputStream
return SUCCESS;
}
public void setCourrierId(String courrierId) {
this.courrierId = courrierId;
}
public String getfileName() {
return fileName;
}
public void setfileName(String fileName) {
this.fileName = fileName;
}
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
}
i searched on the net but i found only solutions with xml Struts and that is not what i want =(