how to handle user defined beans if we are using them in form beans. see the following 
code. Im looking for the jsp code in struts to define the text fields

pls send me the code. 

with thnx.

class MyBean 
{
 private String firstName;
 private String lastName;

 public void setFirstName(String strFirstName){
  this.firstName=strFirstName;
 }
 public String getFirstName(){
  return this.firstName;
 }

 public void setLastName(String strLastName){
  this.lastName=strLastName;
 }
 public String getLastName(){
  return this.lastName;
 }
}

FormBean : 

public class MyForm extends ActionForm
{
 private MyBean mybean;
 private String ssno;

 public void setMybean(MyBean mybean){
  this.mybean=mybean;
 }
 public MyBean getMybean(){
  return this.mybean;
 }
 public void setSsno(String ssno){
  this.ssno=ssno;
 }
 public String getSsno(){
  return this.ssno;
 }
}

 

JSP:

First Name : <input type="text" name="txtFirstName">
Last Name : <input type="text" name="txtLastName">
SSNo : <input type="text" name="txtSSNo">


                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

Reply via email to