public Class MyAction extends ActionSupport implements ModelDrivern<MyForm>{
@ConversionErrorFieldValidator(type=ValidatorType.FIELD,fieldName="age",shortCircuit=true,message="Invalid data type",)
@IntRangeFieldValidator(type=ValidatorType.FIELD, fieldName = "age",min="1",max="99")
@RequiredStringValidator(type = ValidatorType.FIELD, fieldName = "name", message = "Supply Name ")
public String processFormData() throws Exception {
---
---
return SUCCESS;
}
@Validations(
expressions = {
@ExpressionValidator(expression="employeeId == -1", message="Employee not selected"),
@ExpressionValidator(expression="deptd == -1", message="Depatment not selected")
}
)
public String loadForm(){
getLearnableForm().setMinimumRelevance(20);
return SUCCESS;
}
}
Ankit Garg wrote:Arun, you can't write files to client machine like that. You'll have to write the file to the ServletOutputStream. You can only control the name of the file. You'll have to modify your code somehow to work with both the Swing and Struts app...
Ankit Garg wrote:Do you want to save the file on the server or on client machine?? If you want to save the file on client machine, then you cannot control where the file will be saved. When the browser is asked to download a file, it prompts the user about where to store the file. You can control the name of the file using the content-disposition header...