RE: Reference Struts HTML tags from within a custom tag? *Please help!*
What James is suggesting is that by dig(ging) into the source code of the taglibs is that you can: 1. get an appreciation of exactly how these tags operate in the page environment, including what other tags they recognize and can execute as body content; 2. modify the source code to suit your needs (not recommended) and recompile; 3. extend a taglib class that closely meets your needs and add the functionality you want. Concurrent with examining/subclassing the base classes, you will also want to look at/modify the tag TLD file. The great thing about open source (and it's danger) is that you can do anything you want with it. Try modifying the behavior of a Micro$oft app Speaking of open sores [sic], what's up with all the fuss over Red Hat owning 85 percent of the US market? Mark -Original Message- From: John Averty [mailto:[EMAIL PROTECTED]] 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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; John Averty [EMAIL PROTECTED] 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:[EMAIL PROTECTED]] 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: 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]
Re: Re: Reference Struts HTML tags from within a custom tag? *Please help!*
John, If you want to create your own tag and still leverage the existing BaseTag, HtmlTag or anyone of the strut tags, you can create a reference to them by doing the following in you tag: public class YourTag extends TagSupport { protected org.apache.struts.tag.ib.html.BaseTag baseTag = new org.apache.struts.tablib.html.BaseTag(); protected org.apache.struts.tag.ib.html.HtmlTag htmlTag = new org.apache.struts.tablib.html.HtmlTag(); public int doStartTag() throws JspException { //standard struts html tag htmlTag.doStartTag(); //your code here baseTag.doStartTag(); baseTag.doEndTag(); //any additional code return (EVAL_PAGE); } public int doEndTag() throws JspException { //your code here htmlTag.doEndTag(); return (EVAL_PAGE); } public void release() { // release any resources you allocate // release resources from standard struts tags htmlTag.release(); baseTag.release(); } // other methods } // End Class Hope this helps. Regards, Todd G. Nist From: John Averty [EMAIL PROTECTED] Date: 2002/09/11 Wed PM 07:59:47 EDT To: Struts Users Mailing List [EMAIL PROTECTED], [EMAIL PROTECTED] 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. 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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] 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:[EMAIL PROTECTED]] 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
Re: Reference Struts HTML tags from within a custom tag? *Please help!*
Wow. That's a heavy recommendation. You're making me hungry to see this book. I guess it's time I ordered a copy. ... still waiting for your final analysis though! Regards, Eddie Galbreath, Mark wrote: Get James Goddwill's Mastering Jakarta Struts (Wiley 2002); it has a very clear, step-by-step comprehensive turorial for putting together an interactive (is there any other?) application using the framework. It is a great Struts beginner's book. You can find it at any online book store. Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]] 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: 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]
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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; John Averty [EMAIL PROTECTED] 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:[EMAIL PROTECTED]] 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: 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]
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:[EMAIL PROTECTED]] 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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; John Averty [EMAIL PROTECTED] 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:[EMAIL PROTECTED]] 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: 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]
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. 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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] 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:[EMAIL PROTECTED]] 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 [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; John Averty [EMAIL PROTECTED] 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