The short answer is read the java documentation better...
you don't do a new Form(). That won't work for reasons related to Java and passing
variables.
In your struts-config.xml you should set the name, and probably validation=false.
Then something like:
MyForm myForm = (MyForm) form
myForm.setThisField( some.getData());
return mapping.findForward("dearGodItWorked");
in your action class will fill it nicely.
> -Original Message-
> From: KEBE Cheikh Silÿffe8ye [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:14 AM
> To: [EMAIL PROTECTED]
> Subject: can someone help me?
>
>
> hi,
> i have an action class that calls a business object
> (prospect). And i want to display the information for
> a prospect in a form in jsp file (prospect.jsp)
> Here is my struts-config.xml
> type="com.youcompany.struts.form.ProspectForm">
> />
> />
> />
> form-property name="nameP" type="java.lang.String" />
> />
>
> type="java.lang.String" />
>
> />
>
> scope="request"
>
> type="com.youcompany.struts.action.EditprospectAction"
> validate="false">
>
>
>
> here is my prospect.jsp file
>
> type="com.youcompany.struts.form.ProspectForm">
>
>
>
>
>
> nameP
>
>
> readonly="false" size="16"
> maxlength="30"/>
>
>
>
>
> emailGenP
>
>
> size="16" maxlength="30"/> property="emailGenP"/>
>
>
>
>
> phoneP
>
>
> property="phoneP" size="16"
> maxlength="15"/>
>
>
>
>
> emailRhP
>
>
> property="emailRhP" size="16"
> maxlength="30"/>
>
>
>
>
> addressP
>
>
> size="16" maxlength="50"/> property="addressP"/>
>
>
>
>
> emailDcP
>
>
>size="16" maxlength="30"/> property="emailDcP"/>
>
>
>
>
> emailDtP
>
>
>size="16" maxlength="30"/> property="emailDtP"/>
>
>
>
>
> faxP
>
>
> maxlength="15"/>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> In my editProspectAction.java, i do
>
> public ActionForward execute(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
> throws Exception {
> ProspectForm prospect=new ProspectForm();
> // here, i ask my db for retrieving a prospect
> .
>
> form=new ProspectForm();
> form=prospect;
> request.setAttribute(mapping.getAttribute(),form);
> return (mapping.findForward("prospect"));
> }
>
>
> when i do editprospect.do, the prospect.jsp is
> displayed but the prospect data are not pre populate.
> can someone help me?
> thant
>
> =
> Cheikh Silèye KEBE
>
>
>
>
>
>
>
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
> Dialoguez e