Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

ServletFilters and Servlets: Is Running a "Request" in the same Thread?

Thread view: 
joes - 14 Mar 2007 17:35 GMT
Hello

I have a basic question regarding Servlet and ServletFilters. If I do
have a filter, can I assume that the request is running in the same
thread? Or could it be that the filter is running in another context
as the servlet?
Background: we have an existing framework which is using ThreadLocal
variables and therefore it is essential to know how the specification
of a servletciontainer does look like and if someone has experiences
on that?

Many thanks

regards
Mark
Adam Maass - 17 Mar 2007 05:18 GMT
> Hello
>
[quoted text clipped - 8 lines]
>
> Many thanks

I'm not exactly sure what the specification says, but the reference
implementation (IE, Tomcat) runs the ServletFilter and the chained target
Servlet in the same thread for the same request.

It's a pretty safe bet that other implementations of the Servlet
specification do the same thing. Even if the spec itself leaves this detail
underspecified.

-- Adam Maass
Lew - 17 Mar 2007 15:53 GMT
> I'm not exactly sure what the specification says, but the reference
> implementation (IE, Tomcat) runs the ServletFilter and the chained
[quoted text clipped - 3 lines]
> specification do the same thing. Even if the spec itself leaves this
> detail underspecified.

Don't you mean "unspecified"? Meaning you can't count on the behavior?

-- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.