You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2004/10/27 20:20:03 UTC
Exception creating bean of class org.dhsinfo.content.AddFileForm: {1}'
What could lead to a run-time error such as:
[ServletException in:/frame/content/content.jsp]
Exception creating bean of class
org.dhsinfo.content.AddFileForm: {1}'
The strange thing is that the application worked
without any problem before. I did not touch anything.
I re-ran the application a day later and this problem
poped up.
It occurred when I tried to display the content.jsp in
the browser window. The content.jsp portion is like:
<html:form enctype="multipart/form-data"
action="/content/AddFiles">
<html-el:select property="document">
<html-el:option
value="">-Select-</html-el:option>
<html-el:options collection="PageBeans"
property="idAndName" labelProperty="name"/>
</html-el:select>
<input type="text" name="linkname" size="60"
/>
<html:file property="theFile"/>
<html:submit>Submit Updates</html:submit>
<html:reset>Reset Form</html:reset>
</html:form>
The action mapping in the struts-config.xml is like:
<action
path="/content/AddFiles"
type="org.dhsinfo.content.AddFiles"
name="AddFileForm"
scope="request"
validate="false"
input="/do/ContentMgmt">
<forward
name="success"
path=".file.Confirmation"/>
</action>
and the form-bean in the struts-config.xml is like:
<form-bean
name="AddFileForm"
type="org.dhsinfo.content.AddFileForm">
</form-bean>
The AddFileForm.java in the org.dhsinfo.content
directory is like:
package org.dhsinfo.content;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import
org.apache.struts.upload.MultipartRequestHandler;
public class AddFileForm extends ActionForm
{
protected String document;
protected String linkname;
protected FormFile theFile;
public String getDocument()
{
return document;
}
public void setDocument( String document )
{
this.document = document;
}
public String getLinkname()
{
return linkname;
}
public void setLinkname( String linkname )
{
this.linkname = linkname;
}
public FormFile getTheFile()
{
return theFile;
}
public void setTheFile( FormFile theFile )
{
this.theFile = theFile;
}
}
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.
http://messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org