Are custom tags thread-safe?

Discussion in 'Java' started by Big Slim, Dec 9, 2005.

  1. Big Slim

    Big Slim Guest

    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
     
    Big Slim, Dec 9, 2005
    #1
    1. Advertising

  2. Big Slim

    Big Slim Guest

    In article <091220051048440120%>, Big Slim
    <> wrote:

    > 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
     
    Big Slim, Dec 10, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    470
    Ranganath
    Oct 21, 2003
  2. Big Slim

    Are custom tags thread-safe?

    Big Slim, Dec 9, 2005, in forum: Java
    Replies:
    4
    Views:
    1,644
    John C. Bollinger
    Dec 10, 2005
  3. Dave
    Replies:
    0
    Views:
    456
  4. Gabriel Rossetti
    Replies:
    0
    Views:
    1,361
    Gabriel Rossetti
    Aug 29, 2008
  5. John Nagle
    Replies:
    5
    Views:
    485
    John Nagle
    Mar 12, 2012
Loading...

Share This Page