Hello Dear Friends
i have facing problem while using the in
struts file uploading code
here it is giving me an error like - argument type mismatch
can any one tel me what was the problem with the code
ActionForm Code : --
package com.employer.generateResume;
import org.apache.struts.action.*;
import org.apache.struts.upload.FormFile;
/**
* @author Nayan Rami
*/
/**
* Form bean for Struts File Upload.
*
*/
public class GenerateResumeForm extends ActionForm
{
private FormFile theFile;
/**
* @return Returns the theFile.
*/
public FormFile getTheFile() {
return theFile;
}
/**
* @param theFile The FormFile to set.
*/
public void setTheFile(FormFile theFile) {
this.theFile = theFile;
}
private
String candidateName;
private String designation;
private String experiance;
private String currentSalary;
private String expectedSalary;
private String readyToRelocate;
private String education;
private String keySkill;
private String jobDesc;
public String getCandidateName() {
return candidateName;
}
public void setCandidateName(String candidateName) {
this.candidateName = candidateName;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public String getExperiance() {
return experiance;
}
public void setExperiance(String experiance) {
this.experiance = experiance;
}
public String getCurrentSalary() {
return currentSalary;
}
public void setCurrentSalary(String currentSalary) {
this.currentSalary = currentSalary;
}
public String getExpectedSalary() {
return expectedSalary;
}
public void setExpectedSalary(String expectedSalary) {
this.expectedSalary = expectedSalary;
}
public String getReadyToRelocate() {
return readyToRelocate;
}
public void setReadyToRelocate(String readyToRelocate) {
this.readyToRelocate = readyToRelocate;
}
public String getEducation() {
return education;
}
public void setEducation(String education) {
this.education = education;
}
public String getKeySkill() {
return keySkill;
}
public void setKeySkill(String keySkill) {
this.keySkill = keySkill;
}
public String getJobDesc() {
return jobDesc;
}
public void setJobDesc(String jobDesc) {
this.jobDesc = jobDesc;
}
}
My Form ActionClass Code :-
package com.employer.generateResume;
import java.io.File;
import java.io.InputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
public class GenerateResumeAction extends Action {
private String name;
private String designation;
private String experiance;
private String currentSalary;
private String expectedSalary;
private String relocate;
private String education;
private String keySkill;
private FormFile file;
private String jobDescription;
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse responese)throws Exception{
GenerateResumeForm generateResume = (GenerateResumeForm) form;
System.out.println("Hello Dear ");
return null;
}
}
And
Jsp For Form
<html:form action="/GenResume">
<table border="1">
<tr>
<td>Name Of Candidate</td>
<td><html:text name="GenerateResumeForm" size="35" property="candidateName"/></td>
</tr>
<tr>
<td>Candidate Current Designation <br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="designation"/></td>
</tr>
<tr>
<td>Candidate Total Experiance<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="experiance"/></td>
</tr>
<tr>
<td>Current Salary<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="currentSalary"/></td>
</tr>
<tr>
<td>Excpected Salary<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="expectedSalary"/></td>
</tr>
<tr>
<td>Ready To Relocate<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="readyToRelocate"/></td>
</tr>
<tr>
<td>Education<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="education"/></td>
</tr>
<tr>
<td>Key Skill In Field<br /></td>
<td><html:text name="GenerateResumeForm" size="35" property="keySkill"/></td>
</tr>
<tr>
<td>Attach Resume<br /></td>
<td><html:file name="GenerateResumeForm" property="theFile"/></td>
</tr>
<tr>
<td>Job Description<br /></td>
<td><html:textarea name="GenerateResumeForm" cols="27" rows="5" property="jobDesc"/></td>
</tr>
<tr>
<td><br /></td>
<td><html:submit/></td>
</tr>
</table>
</html:form>