File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Authorization on sessions?

 
Grigory O. Ptashko
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, again.

Sorry, if I posted it to the wrong forum, didn't find a more suitable one.
Well.

I'm new to java web-programming but have a huge experience in apache/perl web-programming. I know how to do authorization based on sessions with apache and perl. What is the analog for this, say in Tomcat? Please, point me to the right direction. Actually, I could not find any good documents from the first glance.

I appreciate any comments.
Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This forum is perfect.

I do this by binding an object to session once the user has logged in sucessfully. The object could be anything but let's call it userBean for the sake of discussion.

Then, with each hit, check for the existence of that object (filters make this very easy). If it is null, redirect or forward the user to the login page.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also use declarative security.
There is a link to the servlet spec in my signature.
Download the pdf and scan it for 'security-constraint' for more information.
 
Grigory O. Ptashko
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

yeah, I'm on my way to reading the specification, I've just downloaded it.

But, regarding your first reply - can you tell me some keywords for searching some examples on the net? I mean, I'd like to see "the guts" of session handling in java-based application servers.

Thanks.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pick some keywords from the thread here
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Grigory O. Ptashko:
Ben,

yeah, I'm on my way to reading the specification, I've just downloaded it.

But, regarding your first reply - can you tell me some keywords for searching some examples on the net? I mean, I'd like to see "the guts" of session handling in java-based application servers.

Thanks.



I wrote a sample app that does this.
http://simple.souther.us/not-so-simple.html

Look for SessionMonitor.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic