You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Abey Mullassery <ab...@mullassery.com> on 2004/04/21 07:07:37 UTC

Re: New fitIn tag for image taglib

I added a boolean "bestfit" attribute to the ResizeTag. If it is set, the width and height should also be specified.
It throws a JSPException if it both are not specified (just like the framework does) but I cannot make them mandatory in the tld file :(. I am already doing this kind of "dirty" checks in Resize since I cannot make any of its attributes mandatory in the tld file since it accepts different combinations as you have already seen. 

Would this suffice for now or do we need to split Resize into multiple tags? Let me know your opinion.

Thanks,

Abey Mullassery
http://www.mullassery.com


> ------------Original Message------------
> From: Matti Härö <ma...@infosto.fi>
> To: Tag Libraries Developers List <ta...@jakarta.apache.org>, Felipe Leme <ja...@felipeal.net>
> Cc: Abey Mullassery <ab...@mullassery.com>
> Date: Fri, Mar-26-2004 1:45 PM
> Subject: Re: New fitIn tag for image taglib
> 
> Hello,
> 
> Lainaus Felipe Leme <ja...@felipeal.net>:
> 
> > Regarding Resize and the new FitIn, I think it would be nice if they
> > shared a common structure, say a super class called ResizableTagSupport,
> > with setters for width, length and scale, an abstract method to do the
> > calculations and doStartTag()/doEndTag().
> 
> This is basically a good idea. While considering the creation of a common
> superclass, we need to remember the difference in handling the tag attributes:
> 
> 1) FitIn tag has two attributes (width and height) which are both mandatory.
> 2) Resize tag has three attributes (width, height and scale), of which none
> alone is mandatory. Resize tag accepts multiple different combinations of the
> tag attributes (width only, height only, scale only, width and height together).
> 
> Best regards,
> Matti H�r�
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: New fitIn tag for image taglib

Posted by Felipe Leme <ja...@felipeal.net>.
Abey,

I agree with Matti - it's better to have more classes/tags/handlers with better defined goals than less objects with more generic functionalities

Felipe


On Wed, 2004-04-21 at 02:19, Matti Härö wrote: 
> This 'bestfit' solution is ok also, even though the handling of the resizetag
> attributes and their combinations are now a bit cumbersome. Having two distinct
> tags would be a cleaner solution, for the same reason you just mentioned in your
> email: tag attribute handling in the resizetag (mandatory/non-mandatory in
> various combinations). Now we get a lots of runtime exceptions, instead of
> having a clever validation by the DTD.



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: New fitIn tag for image taglib

Posted by Matti Härö <ma...@infosto.fi>.
This 'bestfit' solution is ok also, even though the handling of the resizetag
attributes and their combinations are now a bit cumbersome. Having two distinct
tags would be a cleaner solution, for the same reason you just mentioned in your
email: tag attribute handling in the resizetag (mandatory/non-mandatory in
various combinations). Now we get a lots of runtime exceptions, instead of
having a clever validation by the DTD.

Matti Härö


Lainaus Abey Mullassery <ab...@mullassery.com>:

> 
> I added a boolean "bestfit" attribute to the ResizeTag. If it is set, the
> width and height should also be specified.
> It throws a JSPException if it both are not specified (just like the
> framework does) but I cannot make them mandatory in the tld file :(. I am
> already doing this kind of "dirty" checks in Resize since I cannot make any
> of its attributes mandatory in the tld file since it accepts different
> combinations as you have already seen. 
> 
> Would this suffice for now or do we need to split Resize into multiple tags?
> Let me know your opinion.
> 
> Thanks,
> 
> Abey Mullassery
> http://www.mullassery.com
> 
> 
> > ------------Original Message------------
> > From: Matti Härö <ma...@infosto.fi>
> > To: Tag Libraries Developers List <ta...@jakarta.apache.org>, Felipe
> Leme <ja...@felipeal.net>
> > Cc: Abey Mullassery <ab...@mullassery.com>
> > Date: Fri, Mar-26-2004 1:45 PM
> > Subject: Re: New fitIn tag for image taglib
> > 
> > Hello,
> > 
> > Lainaus Felipe Leme <ja...@felipeal.net>:
> > 
> > > Regarding Resize and the new FitIn, I think it would be nice if they
> > > shared a common structure, say a super class called
> ResizableTagSupport,
> > > with setters for width, length and scale, an abstract method to do the
> > > calculations and doStartTag()/doEndTag().
> > 
> > This is basically a good idea. While considering the creation of a common
> > superclass, we need to remember the difference in handling the tag
> attributes:
> > 
> > 1) FitIn tag has two attributes (width and height) which are both
> mandatory.
> > 2) Resize tag has three attributes (width, height and scale), of which
> none
> > alone is mandatory. Resize tag accepts multiple different combinations of
> the
> > tag attributes (width only, height only, scale only, width and height
> together).
> > 
> > Best regards,
> > Matti Härö
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> > 
> > 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org