Forums Register Login

returning a object using custom defined tags

+Pie Number of slices to send: Send
hi,
in my application i m using custom defined tag.
How to return a object using custom defined tag, so that i can access in the jsp page that object.
thanks in advance
+Pie Number of slices to send: Send
There are several ways to doing this, depending on how you want to use the object and whether you are using the JSTL expression language:
(1) Put it in the page context and access it from the page with the <jsp:useBean> tag
(2) Put it in the page context and access it from the page with the expression language (if you are using JSTL)
(3) Put it in the page context and, using the TLD or a TagExtraInfo class, declare that you want a scripting variable created on the JSP page so that you can access the object directly (e.g. <%= myObject.getX(); %>
Does that help, or do you need further implementation details?
Simon
Look! It's Leonardo da Vinci! And he brought a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1047 times.
Similar Threads
Q from Hanu's mock test
How do I add multiple taglib's to my deployment descriptor?
body-content for tag files, classic and simple tags
nested custom tags
Writing Image Bytes on Response Stream
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:45:21.