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
<form-bean name="prospectForm"
type="com.youcompany.struts.form.ProspectForm">
<form-property name="emailDtP" type="java.lang.String"
/>
<form-property name="emailRhP" type="java.lang.String"
/>
<form-property name="phoneP" type="java.lang.String"
/>
form-property name="nameP" type="java.lang.String" />
<form-property name="addressP" type="java.lang.String"
/>
<form-property name="faxP" type="java.lang.String" />
<form-property name="emailGenP"
type="java.lang.String" />
<form-property name="idA" type="java.lang.String" />
<form-property name="emailDcP" type="java.lang.String"
/>
</form-bean>
<action name="prospectForm" path="/editprospect"
scope="request"
type="com.youcompany.struts.action.EditprospectAction"
validate="false">
<forward name="prospect" path="/prospect.jsp" />
</action>
here is my prospect.jsp file
<html:form action="/majprospect" name="prospectForm"
type="com.youcompany.struts.form.ProspectForm">
<table border="0" width="100%">
<tr>
<th align="right">
nameP
</th>
<td align="left">
<html:text property="nameP"
readonly="false" size="16"
maxlength="30"/><html:errors property="nameP"/>
</td>
</tr>
<tr>
<th align="right">
emailGenP
</th>
<td align="left">
<html:text property="emailGenP"
size="16" maxlength="30"/><html:errors
property="emailGenP"/>
</td>
</tr>
<tr>
<th align="right">
phoneP
</th>
<td align="left">
<html:text property="phoneP" size="16"
maxlength="15"/><html:errors property="phoneP"/>
</td>
</tr>
<tr>
<th align="right">
emailRhP
</th>
<td align="left">
<html:text property="emailRhP" size="16"
maxlength="30"/><html:errors property="emailRhP"/>
</td>
</tr>
<tr>
<th align="right">
addressP
</th>
<td align="left">
<html:text property="addressP"
size="16" maxlength="50"/><html:errors
property="addressP"/>
</td>
</tr>
<tr>
<th align="right">
emailDcP
</th>
<td align="left">
<html:text property="emailDcP"
size="16" maxlength="30"/><html:errors
property="emailDcP"/>
</td>
</tr>
<tr>
<th align="right">
emailDtP
</th>
<td align="left">
<html:text property="emailDtP"
size="16" maxlength="30"/><html:errors
property="emailDtP"/>
</td>
</tr>
<tr>
<th align="right">
faxP
</th>
<td align="left">
<html:text property="faxP" size="16"
maxlength="15"/><html:errors property="faxP"/>
</td>
</tr>
<tr>
<td align="right">
<html:submit/>
</td>
<td align="left">
<html:cancel/>
</td>
</tr>
</table>
</html:form>
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 en direct avec vos amis gr�ce � Yahoo! Messenger !T�l�chargez Yahoo!
Messenger sur http://fr.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]