I am using a Form File for file Upload in my application.In this i am getting a strange problem.
Input.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:form action="/LoadPowerForecast" method="post" enctype="multipart/form-data">
External Power Forecast Data File : |
<html:file property="theFile"/></[/b]td>
|
|
|
|
<html:submit property="method"><bean:message key="LoadPower.Load"/></html:submit>
|
</html:form>
Form Bean:
package com.ngt.wpfs.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
public class LoadPowerForm extends ActionForm {
private FormFile theFile;
public void setTheFile(FormFile theFile) {
this.theFile = theFile;
}
public FormFile getTheFile() {
return theFile;
}
}
By clicking "Load" submit button,all the data is submitted and then processing is done in Action Class and the action class will forward back it
input.jsp. But while displaying input.jsp from action class the file name which i have selected earlier is not showing in input.jsp .