It looks like you're trying to code a class that would be used in a form
bean and accessed from your page.  You do that like this:

public class MyFormBean...
{
  private Duns duns;

  public Duns getDuns()
  {
    return duns;
  }
}

public class Duns
{
  public Duns();
  public Duns(String value);
  public String toString();

  public getSomeValue()
  {
    return someValue;
  }
}

On your jsp you would have:

  <bean:write name="formbean" property="duns.someValue" />

Just make sure a valid Duns object will always be returned from form
bean's getDuns() method or you'll get exceptions.

Greg

> -----Original Message-----
> From: Dan Tran [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 04, 2002 11:15 AM
> To: Struts Users Mailing List
> Subject: Re: DanaFormBean and Non Primative property type
> 
> 
> Hi Mark,
> 
> I am looking for way to code a custom property in a ActionForm
> 
> For example:
> 
>    public class MyFormBean ....
>    {
>         ......
> 
>         public MyType getMyType() .....
>     }
> 
> If this is not a right place to ask for this kind of question
> then please drop this.
> 
> -D
> ----- Original Message -----
> From: "Galbreath, Mark" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Friday, October 04, 2002 8:51 AM
> Subject: RE: DanaFormBean and Non Primative property type
> 
> 
> > Dan,
> >
> > Are you asking how to code a standard JavaBean for use as 
> an ActionForm
> > object?
> >
> > Mark
> >
> > -----Original Message-----
> > From: Dan Tran [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 04, 2002 10:35 AM
> >
> > I was wrong, String is not a primative type.
> >
> > To make thing more clear, here is my class
> >
> > public class Duns
> > {
> >      public Duns();
> >      public Duns(String value);
> >      public String toString();
> >  }
> >
> > I hope this is clearer this time.
> >
> > -D
> > ----- Original Message -----
> > From: "Galbreath, Mark" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> >
> > > RU kidding?  You need more help than you can get here if 
> you think a
> > String
> > > is a primitive.  And what kind of question is this?  Are 
> we to, like,
> read
> > > your mind and "see" your code to guess whatever it is you 
> are trying to
> do
> > > in your classes?  Hey!  Even we are not that good.  But 
> so this post is
> > not
> > > totally bw wastage, here's a suggestion I hope you appreciate:
> > >
> > > http://www.tuxedo.org/~esr/faqs/smart-questions.html
> > >
> > >
> > > Mark
> > >
> > > -----Original Message-----
> > > From: Dan Tran [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, October 03, 2002 9:39 PM
> > >
> > > Hi I would like to use DataFormBean with properties are
> > > not primative types like int, java.lang.String
> > >
> > > What are the requirements  to create a customized
> > > property type?
> > >
> > > For example,  I have a DUNS java class which is a
> > > specialized string.  What kind of methods in my DUNS 
> class that I need
> to
> > > implement to make DanaFormBean happy? (like toString, 
> DUNS(String init),
> > > etc??)
> > >
> > > Suggestions are greatly appreciated.
> > >
> > > -Dan
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 

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

Reply via email to