This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Restrict the URL Access in Servlets 2.2

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update to the latest j2ee version. Filters are the smoothest way to encapsulate common functionality ...
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use form authentication and protect a URL by configuring the same in web.xml
 
chandra kambham
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
chandra kambham
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sean,

Could you please provide me with the information on Spring security?
 
Sean Clark
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is there any Plug-in kind of thing available for Filters in servlet 2.2 version?
 
chandra kambham
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic