You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Averty <jo...@hotmail.com> on 2002/09/11 23:29:40 UTC

Reference Struts HTML tags from within a custom tag? *Please help!*

Hi,

I'm trying to build a custom tag that would render a (dynamicly generated)
list of fields.

Is there a way for me to:
- get a reference to Strut's HTML tags from within a custom tag? (assuming
we know which tag to get)
- have the html tag handle the rendering?
- still be able to use Strut's validation?

Any ideas out there on how to do that? Any help would be appreciated.

John.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Reference Struts HTML tags from within a custom tag? *Please help!*

Posted by John Averty <jo...@hotmail.com>.
> Well, honestly, Struts has more to offer than you think.  Since you're new
> to it, you should at least try reading Chuck Cavaness' chapters on the
> serverside.com.

I did read that book. It explains how cool Struts is, but I felt that he
didn't really explained me HOW do do stuff. Also, what I'm trying to get to
is not in the book (at least not the chapters that are posted).
Then, I've also gone thru the tutorial and a bunch of other docs and
examples, and haven't found any hint on how to achieve the modularity I'm
looking for.

I've been playing with Struts a bit, and I'm able to do pretty much anything
"within the mold". ActionsForms, dynaForms, client and server validation,
redirects, etc.

But, I'm still new and are just asking for some pointers of what could be an
approach to acheive something more out of the box. I hope you gurus guys
could give me another prospective, before I start digigng in the code (I'm
on schedule...)

The closer I got to something was the concept of having an Actionform backed
by a map, and then insert scriplets in the JSP, but I don't really like this
approach as I prefer to insert code in the tags instead of the page itself.
It is a lot more maintenable for programmers and for non-struts engineers
(aka professional services), and a lot less prone to involuntary sabotage.
I'm also worried about the performance of the code generated if I want my
component to be pretty big/powerfull.

> Word of advice.  If you think "it would be nice if Struts does this".  It
> has probably already been done or at least spec'd out.
... then let me know where or how!!

If I'm missing something obvious or if there is an approach on how to
achieve what I'm trying to do, please point me to it instead of sending me a
rtfm kind of answer.
Or.. if you don't know or don't see a way, let me know also and I'll respect
your judgement as you seem to be quite a guru with the stuff.

> And if not, do it and contribute it back to the community.
No problem, if I have to build something, I'll contribute... But before, I
need to figure out how...


In the mean time, your answer was not helpful at all...

John.


----- Original Message -----
From: "James Mitchell" <jm...@telocity.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, September 11, 2002 4:35 PM
Subject: RE: Reference Struts HTML tags from within a custom tag? *Please
help!*


> Well, honestly, Struts has more to offer than you think.  Since you're new
> to it, you should at least try reading Chuck Cavaness' chapters on the
> serverside.com.  It's free.  Be sure to setup a decent working environment
> while you are reading it.  Go through each tutorial/sample and really dig
> into the code and see what's happening.  Follow the threads from http
> request through the container into the framework and out to the jsp.
>
> Word of advice.  If you think "it would be nice if Struts does this".  It
> has probably already been done or at least spec'd out.  And if not, do it
> and contribute it back to the community.
>
> Later John!
>
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://www.open-tools.org/struts-atlanta
>
>
>
>
> > -----Original Message-----
> > From: John Averty [mailto:john_averty@hotmail.com]
> > Sent: Wednesday, September 11, 2002 7:07 PM
> > To: Struts Users Mailing List
> > Subject: Re: Reference Struts HTML tags from within a custom tag?
> > *Please help!*
> >
> >
> > > Your best bet is to dig into the source code of the taglibs and see
what
> > > names the beans/strings/whatever are being stored under (and the
proper
> > > scope as well).  That way you can get a handle on anything you want.
> >
> > Even if I get a handle on the tags, what do I do with it to associate
them
> > with the ActionForm? Rendering/validation?
> >
> > Sorry if the question sounds dumb; I'm a new Struts user, and I
> > didn't get a
> > good handle yet.
> > But I'm hoping to be able to be more dynamic than what the basic use of
> > Struts allow: my compagny is building an application more than a portal
> > (permissions, roles, etc.)). I'd like to build dynamic and
> > configurable (as
> > of by professional services) components to be able to modify/extend the
> > fields forms without them needing an understanding of Struts.
> >
> > >> Check out the doco as well
> > doco?
> >
> > Thanks,
> >
> > John.
> >
> >
> > ----- Original Message -----
> > From: "James Mitchell" <jm...@telocity.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "John
> > Averty" <jo...@hotmail.com>
> > Sent: Wednesday, September 11, 2002 3:56 PM
> > Subject: RE: Reference Struts HTML tags from within a custom tag?
*Please
> > help!*
> >
> >
> > > Your best bet is to dig into the source code of the taglibs and see
what
> > > names the beans/strings/whatever are being stored under (and the
proper
> > > scope as well).  That way you can get a handle on anything you want.
> > >
> > > Check out the doco as well.  There's plenty info out there.
> > >
> > > HTH
> > >
> > > James Mitchell
> > > Software Engineer\Struts Evangelist
> > > Struts-Atlanta, the "Open Minded Developer Network"
> > > http://www.open-tools.org/struts-atlanta
> > >
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: John Averty [mailto:john_averty@hotmail.com]
> > > > Sent: Wednesday, September 11, 2002 5:30 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Reference Struts HTML tags from within a custom tag?
*Please
> > > > help!*
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I'm trying to build a custom tag that would render a (dynamicly
> > generated)
> > > > list of fields.
> > > >
> > > > Is there a way for me to:
> > > > - get a reference to Strut's HTML tags from within a custom tag?
> > (assuming
> > > > we know which tag to get)
> > > > - have the html tag handle the rendering?
> > > > - still be able to use Strut's validation?
> > > >
> > > > Any ideas out there on how to do that? Any help would be
appreciated.
> > > >
> > > > John.
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Reference Struts HTML tags from within a custom tag? *Please help!*

Posted by James Mitchell <jm...@telocity.com>.
Well, honestly, Struts has more to offer than you think.  Since you're new
to it, you should at least try reading Chuck Cavaness' chapters on the
serverside.com.  It's free.  Be sure to setup a decent working environment
while you are reading it.  Go through each tutorial/sample and really dig
into the code and see what's happening.  Follow the threads from http
request through the container into the framework and out to the jsp.

Word of advice.  If you think "it would be nice if Struts does this".  It
has probably already been done or at least spec'd out.  And if not, do it
and contribute it back to the community.

Later John!


James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: John Averty [mailto:john_averty@hotmail.com]
> Sent: Wednesday, September 11, 2002 7:07 PM
> To: Struts Users Mailing List
> Subject: Re: Reference Struts HTML tags from within a custom tag?
> *Please help!*
>
>
> > Your best bet is to dig into the source code of the taglibs and see what
> > names the beans/strings/whatever are being stored under (and the proper
> > scope as well).  That way you can get a handle on anything you want.
>
> Even if I get a handle on the tags, what do I do with it to associate them
> with the ActionForm? Rendering/validation?
>
> Sorry if the question sounds dumb; I'm a new Struts user, and I
> didn't get a
> good handle yet.
> But I'm hoping to be able to be more dynamic than what the basic use of
> Struts allow: my compagny is building an application more than a portal
> (permissions, roles, etc.)). I'd like to build dynamic and
> configurable (as
> of by professional services) components to be able to modify/extend the
> fields forms without them needing an understanding of Struts.
>
> >> Check out the doco as well
> doco?
>
> Thanks,
>
> John.
>
>
> ----- Original Message -----
> From: "James Mitchell" <jm...@telocity.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "John
> Averty" <jo...@hotmail.com>
> Sent: Wednesday, September 11, 2002 3:56 PM
> Subject: RE: Reference Struts HTML tags from within a custom tag? *Please
> help!*
>
>
> > Your best bet is to dig into the source code of the taglibs and see what
> > names the beans/strings/whatever are being stored under (and the proper
> > scope as well).  That way you can get a handle on anything you want.
> >
> > Check out the doco as well.  There's plenty info out there.
> >
> > HTH
> >
> > James Mitchell
> > Software Engineer\Struts Evangelist
> > Struts-Atlanta, the "Open Minded Developer Network"
> > http://www.open-tools.org/struts-atlanta
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: John Averty [mailto:john_averty@hotmail.com]
> > > Sent: Wednesday, September 11, 2002 5:30 PM
> > > To: Struts Users Mailing List
> > > Subject: Reference Struts HTML tags from within a custom tag? *Please
> > > help!*
> > >
> > >
> > > Hi,
> > >
> > > I'm trying to build a custom tag that would render a (dynamicly
> generated)
> > > list of fields.
> > >
> > > Is there a way for me to:
> > > - get a reference to Strut's HTML tags from within a custom tag?
> (assuming
> > > we know which tag to get)
> > > - have the html tag handle the rendering?
> > > - still be able to use Strut's validation?
> > >
> > > Any ideas out there on how to do that? Any help would be appreciated.
> > >
> > > John.
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Reference Struts HTML tags from within a custom tag? *Please help!*

Posted by John Averty <jo...@hotmail.com>.
> Your best bet is to dig into the source code of the taglibs and see what
> names the beans/strings/whatever are being stored under (and the proper
> scope as well).  That way you can get a handle on anything you want.

Even if I get a handle on the tags, what do I do with it to associate them
with the ActionForm? Rendering/validation?

Sorry if the question sounds dumb; I'm a new Struts user, and I didn't get a
good handle yet.
But I'm hoping to be able to be more dynamic than what the basic use of
Struts allow: my compagny is building an application more than a portal
(permissions, roles, etc.)). I'd like to build dynamic and configurable (as
of by professional services) components to be able to modify/extend the
fields forms without them needing an understanding of Struts.

>> Check out the doco as well
doco?

Thanks,

John.


----- Original Message -----
From: "James Mitchell" <jm...@telocity.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "John
Averty" <jo...@hotmail.com>
Sent: Wednesday, September 11, 2002 3:56 PM
Subject: RE: Reference Struts HTML tags from within a custom tag? *Please
help!*


> Your best bet is to dig into the source code of the taglibs and see what
> names the beans/strings/whatever are being stored under (and the proper
> scope as well).  That way you can get a handle on anything you want.
>
> Check out the doco as well.  There's plenty info out there.
>
> HTH
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://www.open-tools.org/struts-atlanta
>
>
>
>
> > -----Original Message-----
> > From: John Averty [mailto:john_averty@hotmail.com]
> > Sent: Wednesday, September 11, 2002 5:30 PM
> > To: Struts Users Mailing List
> > Subject: Reference Struts HTML tags from within a custom tag? *Please
> > help!*
> >
> >
> > Hi,
> >
> > I'm trying to build a custom tag that would render a (dynamicly
generated)
> > list of fields.
> >
> > Is there a way for me to:
> > - get a reference to Strut's HTML tags from within a custom tag?
(assuming
> > we know which tag to get)
> > - have the html tag handle the rendering?
> > - still be able to use Strut's validation?
> >
> > Any ideas out there on how to do that? Any help would be appreciated.
> >
> > John.
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Reference Struts HTML tags from within a custom tag? *Please help!*

Posted by James Mitchell <jm...@telocity.com>.
Your best bet is to dig into the source code of the taglibs and see what
names the beans/strings/whatever are being stored under (and the proper
scope as well).  That way you can get a handle on anything you want.

Check out the doco as well.  There's plenty info out there.

HTH

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: John Averty [mailto:john_averty@hotmail.com]
> Sent: Wednesday, September 11, 2002 5:30 PM
> To: Struts Users Mailing List
> Subject: Reference Struts HTML tags from within a custom tag? *Please
> help!*
>
>
> Hi,
>
> I'm trying to build a custom tag that would render a (dynamicly generated)
> list of fields.
>
> Is there a way for me to:
> - get a reference to Strut's HTML tags from within a custom tag? (assuming
> we know which tag to get)
> - have the html tag handle the rendering?
> - still be able to use Strut's validation?
>
> Any ideas out there on how to do that? Any help would be appreciated.
>
> John.
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>