jsp - Custom Tag inheritance. -


I have a JSP custom tag "A" which is defined in my .tld. I have 3 essential properties, it is an attangler That simplifies the hedgehanger in heritage. I need a new tag "B" which does a very little thing in the form of the above "A" but in a slightly different way. In addition to those attributes in "A", I copied them into ".b" in .tld file (code duplication). Apart from this, I made a bitagainthalar as an intagladler, and by these means actually crossed some of the methods, which in fact actually turn into these two handlers. And the rest of the functionality is defined in "Attahhandler". Because of its tranquility on Java, many codes avoid duplication due to heritage.

But in the .tld file with the definition of Tag A and TAG B, there is a duplication of the attribute definition. Is there a way to avoid this repetition? If not, is there a completely different approach to me? Problem (Both tags excatly do the same thing, but a slight change, I used heritage)

Regards, lamps

I think you are living with TLD repetition, I know what you want to do, to do this There is no way. It is disturbing, and it does not look right, but the TLD files are raw and ugly.

You have the option, though, to implement the javax.servlet.jsp.tagext.DynamicAttributes interface. This allows you to leave special announcements from TLD, so that you do not have to repeat them, but the downside is that the attribute value will be passed in the form of a name-value pair instead of the Jaababian property, so they are not as good Are to use.

So this is an option between dislikes in TLD or disrespect in Java. Make your selection.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -