Solved

Usernames and Servlets

Posted on 2001-06-20
5
245 Views
Last Modified: 2013-11-24
Is there any way that I can get a users login id when they access my servlet?

I know that you can do this in ordinary Java using:

System.getProperty("user.name");

...but this does not work with servlet and will only retrieve the servler login.

The user does not pass their login ID with the request parameters.

Any ideas???

Philip
0
Comment
Question by:philipstewart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:smileyxx
ID: 6211634
If you do user authentication (login) than you can.
A request coming in over HTTP has no information about the user that is making that request.
0
 

Expert Comment

by:Nachiap
ID: 6212985
are you getting user name or id & password while login..?
if so then u can access that information & stop him accessing that servlet.
you can have login name or id in session or in database..
& check where ever you want..
0
 

Author Comment

by:philipstewart
ID: 6213415
Hi

The user does not have to login, but I need to get their ID to do security checks, in the background (and also without the user knowing  -- more so the user doesn't have to know as this is then used to determine what resources they have access to.

Thanks
0
 

Accepted Solution

by:
Nachiap earned 20 total points
ID: 6213474
In Http request you cant distinguish between requests
(as of my knowledge).
so you have to have some login procedure as per your requirement..
0
 

Expert Comment

by:CleanupPing
ID: 9062027
philipstewart:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question