I am writing some custom tags at the moment and I was wondering instead of passing strings and integers as attributes to this custom tag. Is it possible to pass an Object to the custom tag. From what I have read it seems to be possible but when I tried it Eclipse was not too happy about it. I am using jstl 1.1
I am using JSP2.0 tag and following is what you can do.
Let's say you want to format address at more than one pages in your web application. So you are creating a formatAddress.tag which is re-usable.You will simply pass your address object and the tag will format it.(i.e Label, Adress line 1 , Address line 2 ,... )
Following is the code snippet for formatAddress.tag,look at the attribute specified.
<%@ tag description = "Outputs an address object in the correct format." pageEncoding="UTF-8"%>