I am developing an j2ee based application .
Should I put the code to
1) Authenticating the user
2) Simple Session check whether the session is valid
3) Encripting and decripting the request and response
OR in
a) Servlets with some helper classes
another question i have is whether filter are thread safe?
if not why it does not need to be thread safe
-
Filter vs Servlet (2 messages)
- Posted by: arun p
- Posted on: April 08 2005 00:00 EDT
Threaded Messages (2)
- Filter vs Servlet by Colin Yates on April 08 2005 05:39 EDT
- Filter vs Servlet by satya katta on April 08 2005 14:49 EDT
-
Filter vs Servlet[ Go to top ]
- Posted by: Colin Yates
- Posted on: April 08 2005 05:39 EDT
- in response to arun p
Think of a filter as a guard. Only if certain preconditions pass will it allow execution to continue.
A typical example of a filter would be to ensure a user is logged on.
For any logic where it states "only happen if.." kinda implies a filter.
Col -
Filter vs Servlet[ Go to top ]
- Posted by: satya katta
- Posted on: April 08 2005 14:49 EDT
- in response to Colin Yates
Usually servlet filters are used to check for something which is common across all the users of the web application. The servlet container instantiates only one instance of the filter and the same is used to serve all the clients. If you maintaine the state of a user in a servlet filter then it will cause prolems..