Are custom tags thread-safe?

B

Big Slim

Are instance variables in custom tags thread-safe? I need two different
JSPs to use the same custom tag, so I have a setter method for an
instance variable called "page." The tag does things a bit differently
depending on which page called it.

A Java programmer I know told me I don't have to worry about it as long
as I let the tag "fall out of scope." If I'm not mistaken, though, one
instance of the tag will be created for all threads to share, just like
a servlet, right?

Any clarity on this subject would be greatly appreciated. Thanks--Big
Slim
 
B

Big Slim

Big Slim said:
Are instance variables in custom tags thread-safe? I need two different
JSPs to use the same custom tag, so I have a setter method for an
instance variable called "page." The tag does things a bit differently
depending on which page called it.

A Java programmer I know told me I don't have to worry about it as long
as I let the tag "fall out of scope." If I'm not mistaken, though, one
instance of the tag will be created for all threads to share, just like
a servlet, right?

Any clarity on this subject would be greatly appreciated. Thanks--Big
Slim

Whoops! Didn't mean to post the same question again. I thought my
original post hadn't gone through.

Thank you both for your responses. I'm awfully glad custom tags are
thread-safe. I was sweating bullets there for a while!

--Big Slim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top