Assuming you are using Struts-2?
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/DefaultActionSupport.html#getSuccessResultValue()
you will need these methods
public String getSuccessResultValue()
public void setSuccessResultValue(String successResultValue)

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 06, 2007 12:47 PM
Subject: Re: populating a bean


Hartrich, James CTR USTRANSCOM J6 wrote:
So you are going from the jsp to the action, correct?
That being the case, you are doing this correctly so far. Make certain
to have an encapsulated property for accountBean in your accountManager
action. On submit the accountBean object will be constructed and
setFirstName will be called. The bean will be set on your accountManager
action.
that's exactly what I am doing. But it's not populating the field. The field still shows null.
Here's a code from my AccountManager:


public class AccountManager   extends ActionSupport{

   private Account account ;
   private AccountBean accountBean ;
  public String execute()
   {
       // TODO - read the coments
//if there's account number then retrieve the correspondiing account and dislay //if there's field for the accout then create the account and dislay
       //if none then forward to the new account page
       return "SUCCESS" ;  //temporarily
   }

   public AccountBean getAccountBean() {
       return accountBean;
   }

   public void setAccountBean(AccountBean accountBean) {
       this.accountBean = accountBean;
   }
  }


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, April 06, 2007 11:32 AM
To: Struts Users Mailing List
Subject: populating a bean

how do I populate a bean values from a jsp page ?

here's what I need to do:


<s:form action="accountManager"  method="post" >
<s:textfield name="accountBean.firstName" label="First Name" />
<s:submit> </s:submit>
</s:form>


this page http://struts.apache.org/2.0.6/docs/how-do-i-populate-a-form-bean-and-ge
t-the-value-using-the-taglib.html
how to read the values from the bean but not how to populate them. Or may be I am not getting it...






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to