These tags are going to be reused many times throughout our application, and I prefer to omit this type of decision logic from the jsp pages. Therefore I think it pays to design custom tags to accomplish what I need.
I have been looking at some of the source code for the various tag handlers that extend BaseTagHandler, and I see there is a lot going on. I would like to make sure to leverage all of the functionality included in BaseTagHandler. I was wondering if there is some documentation out there for creating new BaseTagHandler extensions, or custom Struts HTML components in general. I understand how to create taglibs in general, I am asking whether there is such specific documentation for Struts. Much thanks/Victor Grazi -----Original Message----- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 17, 2004 4:42 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Generating struts tags from a Java Bean The standard struts-example webapp has a case of conditional rendering as well. The "registration.jsp" page is used for both "Create a New User" and "Log In As Existing User"., but only in the latter case does it show the table at the bottom. This is controlled by the following tag around the table: <logic:equal name="RegistrationForm" property="action" scope="request" value="Edit"> ... </logic:equal> which makes sure that the "action" property on the "RegistrationForm" bean equals "Edit" before displaying the table. Craig On Tue, 17 Aug 2004 16:13 -0400, Victor Grazi <[EMAIL PROTECTED]> wrote: > The custom tag approach seems like the way to go. Is there any > documentation for considerations besides just perusing the source code > for exisiting html tags? > Regards > Victor > > ....... Original Message ....... > > > On Tue, 17 Aug 2004 10:53:29 -0700 "Jim Barrows" <[EMAIL PROTECTED]> wrote: > > > > > >> -----Original Message----- > >> From: Victor Grazi [mailto:[EMAIL PROTECTED] > >> Sent: Tuesday, August 17, 2004 10:35 AM > >> To: Struts Users Mailing List > >> Subject: RE: Generating struts tags from a Java Bean > >> > >> > >> the problem we are trying to solve is that depending on user > >> entitlements and application state, some fields need to either be a > >> drop down or just text. > > > >What I would suggest then, is to figure that out in your action > >class, and > pass boolean values as part of the form bean. Then on the jsp page, > use <logic:equal or <c:if to determine what to show. > > > >Alternatively you could write your own tag library for the field, > >which > would figure out what html to generate based on the attributes you give it. > Something like: > ><myCompany:inputField value="${formName.fieldName}" > applicationState="${applicationState}"/> > >You can of course get a list of roles from isUserInRole(), or hand > >them in if your doing > something else. > > > >If you have only 1 or 2 pages, then the first option may be easier, > >but if you're doing it a > lot then the taglib option might be better. > > > >> > >> > >> ___ > >> Sent with SnapperMail > >> www.snappermail.com > >> > >> ...... Original Message ....... > >> On Tue, 17 Aug 2004 09:46:49 -0700 "Jim Barrows" > >> <[EMAIL PROTECTED]> wrote: > >> > > >> > > >> >> -----Original Message----- > >> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> >> Sent: Tuesday, August 17, 2004 9:42 AM > >> >> To: Struts Users Mailing List > >> >> Subject: Generating struts tags from a Java Bean > >> >> > >> >> > >> >> I would like to generate struts tags from a Java bean, which > >> >> would decide what tags to generate based on context. > >> >> Is there any way to configure the JSP so that it will evaluate > >> >> the JavaBean first, before the struts tags, so that the struts > >> >> tags can be generated by the beans? > >> > > >> >I don't believe so. Since struts tags only generate html, > >> you could have > >> beans that generate html based on context. However, given that > >> struts and jstl have some rather powerful logical statements, you > >> might be able to achieve what you want without doing away with > >> struts tags, which is what you are basically asking. > >> > > >> >What problem are you trying to solve? > >> > > >> > > >> >------------------------------------------------------------------ > >> >--- To unsubscribe, e-mail: [EMAIL PROTECTED] > >> >For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > >> > >> ------------------------------------------------------------------- > >> -- To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]