You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tony Anecito <ad...@yahoo.com> on 2011/02/24 21:25:59 UTC

When will SingleThreadModel be removed?

Hi All,

When do you think SingleThreadModel will go from deprecated to being gone? I 
noticed with Tomcat 7 it is still present so I am assuming Servlet 3.0 api still 
has it present.

Is it true by default all JSP's use it unless otherwise specified?

Thanks,
-Tony


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] When will SingleThreadModel be removed?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 2/24/2011 3:34 PM, Caldarale, Charles R wrote:
>> From: Tony Anecito [mailto:adanecito@yahoo.com] 
>> Subject: When will SingleThreadModel be removed?
> 
>> When do you think SingleThreadModel will go from 
>> deprecated to being gone?
> 
> Not soon enough.

:)

Oddly enough, while the Servlet Spec has gone from tolerating the STM
for servlets to being anti-STM, the Struts folks have gone the opposite
direction. It used to be (Struts 1) that you'd write an "action", which
is analogous to a servlet, and it would be called from Struts's front
controller (which was a servlet).

In Struts 2, they have deprecated that model in favor of one where the
"action" actually gets instantiated solely for the purposes of handling
a single request. This allows action objects to store their own internal
state in members instead of using the request scope or local variables.
It also allows the framework to do all kinds of wonderful things such as
dependency injection, request parameter delivery, etc. all while being
independent of the Servlet API itself. That means it's easier to write
unit tests, re-use code, etc.

Given that the Servlet spec has also changed models from using
Servlet.init for initialization code to using ServletContextListener, I
would think that a model for servlet dispatching that looked like this
wouldn't be too bad:

Class servletClass = /* determine class to handle request */
Servlet servlet = servletClass.newInstance();

servlet.service(request, response);

That's essentially what STM does, anyhow (if you ignore servlet instance
pooling, which I suspect most containers provide).

The problem, I guess, is that the same old, funky code that uses STM
also uses Servlet.init to set up the servlet context.

It just seems like the "current" Servlet model is rather dated, IMHO,
with respect to Struts's model. When I read about how Struts 2 does
things, I found myself saying "why wasn't it always this way?".

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1tZOsACgkQ9CaO5/Lv0PACLwCffYPkIBCembyLHrn/k0hG1bI9
E38AoJz5KOecrdxUuWEoPz+bvSNZHhTU
=Hp7n
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will SingleThreadModel be removed?

Posted by Tony Anecito <ad...@yahoo.com>.
Okay maybe the best way is to do a form of grep and jarscan. Grep for the 
isThreadSafe existance and jarscan for the SingleThreadModel class.

Regards,
-Tony



----- Original Message ----
From: Tony Anecito <ad...@yahoo.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 2:26:22 PM
Subject: Re: When will SingleThreadModel be removed?

I am betting you are right. Have you ever scanned for it? I was thinking jarscan 

might do the trick but it does not cover jsp's where the isThreadSafe is set to 
false. I am just hinking it is good from a System Admin point of view that it is 

there. Or maybe not :]

Thanks,
-Tony



----- Original Message ----
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 2:16:36 PM
Subject: RE: When will SingleThreadModel be removed?

> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: Re: When will SingleThreadModel be removed?

> Either way when Oracle removes it it will be like 
> Y2K all over again.

My guess is that it will never be removed - just as all the other deprecated 
classes and APIs deprecated over ten years ago are still hanging around.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will SingleThreadModel be removed?

Posted by Tony Anecito <ad...@yahoo.com>.
I am betting you are right. Have you ever scanned for it? I was thinking jarscan 
might do the trick but it does not cover jsp's where the isThreadSafe is set to 
false. I am just hinking it is good from a System Admin point of view that it is 
there. Or maybe not :]

Thanks,
-Tony



----- Original Message ----
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 2:16:36 PM
Subject: RE: When will SingleThreadModel be removed?

> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: Re: When will SingleThreadModel be removed?

> Either way when Oracle removes it it will be like 
> Y2K all over again.

My guess is that it will never be removed - just as all the other deprecated 
classes and APIs deprecated over ten years ago are still hanging around.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will SingleThreadModel be removed?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 2/24/2011 4:16 PM, Caldarale, Charles R wrote:
>> From: Tony Anecito [mailto:adanecito@yahoo.com] 
>> Subject: Re: When will SingleThreadModel be removed?
> 
>> Either way when Oracle removes it it will be like 
>> Y2K all over again.
> 
> My guess is that it will never be removed - just as all the other
> deprecated classes and APIs deprecated over ten years ago are still
> hanging around.

The spec may require that it remain, though it's use might actually be
forbidden in future spec versions. It will have to remain because a
container may have to run a webapp which declares a <web-app
version="2.3"> and it has to behave in the same way. The webapp version
triggers a lot of behavioral changes already... this could be one of
them in the future: if the Servlet class, as it's loaded, implements
SingleThreadModel, the container just throws an exception.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1tZfoACgkQ9CaO5/Lv0PDJZgCffis7U+Kcy2SaLz7mZhDcmSEt
KQUAoI7M+cLxvfvcGV5j/zkTzePawkuw
=dARN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: When will SingleThreadModel be removed?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: Re: When will SingleThreadModel be removed?

> Either way when Oracle removes it it will be like 
> Y2K all over again.

My guess is that it will never be removed - just as all the other deprecated classes and APIs deprecated over ten years ago are still hanging around.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will SingleThreadModel be removed?

Posted by Tony Anecito <ad...@yahoo.com>.
Either way when Oracle removes it it will be like Y2K all over again. All the 
sites using Java will have to inspect all the code & JSP's somehow.
The hope is no one was crazy enough to use SingleThreadModel but of course the 
temptation to use a thread safe model (though it can be misused and made 
non-threadsafe) will be great to the casual developer not realizing they put a 
ticking timebomb in the container.

Thanks,
-Tony



----- Original Message ----
From: Tony Anecito <ad...@yahoo.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 1:48:49 PM
Subject: Re: When will SingleThreadModel be removed?

Thanks I did some more research and found out you are right about the 
isThreadSafe setting. I thought I saw otherwise somewhere else.

-Tony



----- Original Message ----
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 1:34:24 PM
Subject: RE: When will SingleThreadModel be removed?

> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: When will SingleThreadModel be removed?

> When do you think SingleThreadModel will go from 
> deprecated to being gone?

Not soon enough.

> I noticed with Tomcat 7 it is still present so I am assuming 
> Servlet 3.0 api still has it present.

And still deprecated.

> Is it true by default all JSP's use it unless otherwise specified?

No - read the JSP spec; the default value for isThreadSafe is true and has been 
for quite some time.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: When will SingleThreadModel be removed?

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks I did some more research and found out you are right about the 
isThreadSafe setting. I thought I saw otherwise somewhere else.

-Tony



----- Original Message ----
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, February 24, 2011 1:34:24 PM
Subject: RE: When will SingleThreadModel be removed?

> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: When will SingleThreadModel be removed?

> When do you think SingleThreadModel will go from 
> deprecated to being gone?

Not soon enough.

> I noticed with Tomcat 7 it is still present so I am assuming 
> Servlet 3.0 api still has it present.

And still deprecated.

> Is it true by default all JSP's use it unless otherwise specified?

No - read the JSP spec; the default value for isThreadSafe is true and has been 
for quite some time.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: When will SingleThreadModel be removed?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tony Anecito [mailto:adanecito@yahoo.com] 
> Subject: When will SingleThreadModel be removed?

> When do you think SingleThreadModel will go from 
> deprecated to being gone?

Not soon enough.

> I noticed with Tomcat 7 it is still present so I am assuming 
> Servlet 3.0 api still has it present.

And still deprecated.

> Is it true by default all JSP's use it unless otherwise specified?

No - read the JSP spec; the default value for isThreadSafe is true and has been for quite some time.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org