File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Restrict the URL Access in Servlets 2.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Restrict the URL Access in Servlets 2.2" Watch "Restrict the URL Access in Servlets 2.2" New topic
Author

Restrict the URL Access in Servlets 2.2

chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi,

In our Application We are having an individual Servlet for each of the Functionality.
All these servlets were initially designed with out considering the aspect of Authorization.

Now we have a requirement to perform the Authorization for each of these servlets before the request for them is processed at server side.
To achive this I need to change all of my existing servlets to implement the authorization logic in them.
We are using the servlet engine 2.2 .. so we are not able to use the Filters Concept.

Is there any alternate way to do this with out changing all of the servlets?

Many Thanks,
K.Chandra.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Update to the latest j2ee version. Filters are the smoothest way to encapsulate common functionality ...


JDBCSupport - An easy to use, light-weight JDBC framework -
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

You can use form authentication and protect a URL by configuring the same in web.xml


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi Sebastian Janisch,

Currently We don't have the option to upgrade our server to a new version.
So I need to look for an alternate solution in the Servlet 2.2 version itself.

Hi Deepak Bala,

Could you please explain me about the form authentication mechanism and the web.xml configuration to protect a URL?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Here is a nice article that explains that

http://onjava.com/lpt/a/2411

Its a little old but the core concepts should still hold good
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi Deepak,

Thank you very much for the link provided.

But in our application we are already having an custom authentication mechanism using the TAM (Tivoli Access Manager).
So i can't write one more Authentication mechanism using this form based authentication.

Is there any way to Write Filter Kind of Functionality in Servlet 2.2 version?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I believe the support for filters started with the 2.3 version of the servlet spec. As posted, using a filter is one of the easiest ways to achieve the functionality that you need.

chandra kambham wrote:Hi Deepak,

Is there any way to Write Filter Kind of Functionality in Servlet 2.2 version?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

I know that spring security is very pluggable and works well even in applications that do not use Spring.
It also allows you to define access to certain URLs based on roles that you can define.

Sean


I love this place!
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi Sean,

Could you please provide me with the information on Spring security?
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

The website is spring security website. If you have any specific questions, then please post them. I'm sure someone will be able to help.

Sean
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi,

Is there any Plug-in kind of thing available for Filters in servlet 2.2 version?
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi,

Is there a way that I can implement the Filter kind Functionality on my Own in servlet 2.2 version?
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Through google i found that there is some plugin available for filters in servlet 2.2 version for WebSphere Server.

Is there any such plugin available for SUN ONE Portal Server 6.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restrict the URL Access in Servlets 2.2