I am certainly not a master at Struts, but I can give you a few hints that
may save you some time.

The best way I learned about taglibs was trial and error/asking others and
rummaging through the example code trying to figure it out.  (Having
auto-complete in Netbeans doesn't hurt either.  Although that doesn't help
with what you require)


* Stuff the Bean *
When you want to leverage existing beans and/or VOs, just put them into the
view and nest the taglib calls.
So having an ActionForm with a field called username (w/approp mutators),
then the taglib might look like this....
<html:text property="username"/>

If you had added an existing bean into the form in your action before
forwarding and you can do this....
<html:text property="bean.username"/>


* Reduce the complexity and maintainability of the view *
The DynaActionForm is, in my opinion, a wonderful part of the framework that
lets you specify in the struts-config.xml file the xml equivalent of an
ActionForm. Struts provides all the leg work of population (without code
generation).  I fits cleanly into your existing jsp taglibs WITHOUT changing
your jsp code (in the example above).  This saves the time of maintaining
both the bean code/validation and the config file.

    <form-bean      name="logonForm"
                    type="org.apache.struts.action.DynaActionForm">
      <form-property name="username"   type="java.lang.String"/>
      <form-property name="password"   type="java.lang.String"/>
    </form-bean>

Need a new field in your bean?  Don't modify code and recompile, just add
another form-property and you are done.
Then use it in any jsp that uses your form.  It really is that simple.

    <form-bean      name="logonForm"
                    type="org.apache.struts.action.DynaActionForm">
      <form-property name="username"   type="java.lang.String"/>
      <form-property name="password"   type="java.lang.String"/>
      <form-property name="additional" type="java.lang.String"/>
    </form-bean>

After coding in ASP for over 5 years, I have come to REALLY, REALLY
appreciate this framework.
MS .Net promises to provide something similar to the whole MVC architecture,
but from what I've seen it's not mature enough, and probably won't be for a
while.

I could go on for days about the benefits of using Struts, but it's getting
late and I need to put my 2 year old in bed.
Hope this helps a little.

Oh and by the way, if you hang out on this list for a few weeks, you'll see
just how powerful this thing can be.

JM

Right now I'm having amnesia and deja vu at the same time. I think I've
forgotten this before.


> -----Original Message-----
> From: Mark Udstrand [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 10, 2002 12:28 AM
> To: Struts Users Mailing List
> Subject: Re: Struts Beginner - Looking for *decent* documentation
>
>
>
> Well, I have spent the last 15 years designing and developing complex
> transaction switching architectures for the healthcare industry,
> unfortunately very little of this work was with the presentation
> layer.   I
> am somewhat familiar with html and jsp, however I have never worked with
> taglibs.  I understand what they are and how they work, however I need to
> know the syntax and usage of these tags.  Once I have that information, it
> should be easier to determine if Struts is the tool to use for my
> application.
>
> What I am trying to do is quite basic.  I would like to serve up
> a jsp that
> contains a form.  The form populates a javabean that is passed into a
> servlet, the action controller does some work based on the contents of the
> javabean, and the result is displayed in a jsp.  Pretty straightforward.
> However, it is very difficult to populate the bean without
> documentation for
> the struts-form taglib.  If this is a bad approach, maybe you can point me
> in the correct direction.
>
> Thanks.
>
> ----- Original Message -----
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, May 09, 2002 11:15 PM
> Subject: RE: Struts Beginner - Looking for *decent* documentation
>
>
> > What kinds of questions do you have?
> >
> > JM
> >
> > > -----Original Message-----
> > > From: Mark Udstrand [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, May 10, 2002 12:12 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: Struts Beginner - Looking for *decent* documentation
> > >
> > >
> > >
> > > The primary issue I am having surrounds the usage of a form within
> Struts.
> > > I have been searching the web for documentation surrounding the
> > > struts-form
> > > taglib and cannot find anything.  Any ideas where I may locate such a
> > > document?
> > >
> > > M.
> > >
> > > ----- Original Message -----
> > > From: "James Mitchell" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Thursday, May 09, 2002 11:05 PM
> > > Subject: RE: Struts Beginner - Looking for *decent* documentation
> > >
> > >
> > > > I agree.  The documentation is a little hard to follow.
> > > >
> > > > There are many other places that have docs and samples....check out
> some
> > > of
> > > > these links.
> > > >
> > > > http://jakarta.apache.org/struts/resources.html
> > > >
> > > >
> > > > JM
> > > >
> > > > > -----Original Message-----
> > > > > From: Mark Udstrand [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Thursday, May 09, 2002 11:50 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Struts Beginner - Looking for *decent* documentation
> > > > >
> > > > >
> > > > >
> > > > > I have been working at implementing Struts into an existing web
> > > > > framework for the past several days and I feel that the only
> > > > > progress that I have made is that the documentation for Struts is
> > > > > generally poor and very disorganized.  I hope that I am incorrect
> > > > > and that someone can point me to a *good* reference with a few
> > > > > straightforward examples.  Much of my frustration surrounds the
> > > > > documentation for the taglibs.  I am interested in documentation
> > > > > that explains the purpose and usage of each tag, not some generic
> > > > > definition of the tag.
> > > > >
> > > > > What I am trying to accomplish is pretty straight forward,
> > > > > however I have spinning my wheels for the last several days as I
> > > > > attempt to work my way through 4 different Struts examples,
> > > > > trying to correlate the contents back to the Struts
> > > > > documentation.  I believe that Struts is a good tool, however if
> > > > > my experience is indicative of a first time user, the lack of
> > > > > documentation only serves to lessen the usefulness of this tool.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > M.
> > > > >
> > > >
> > > >
> > > > --
> > > > 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]>
> >
>
>
> --
> 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