Solved

Usernames and Servlets

Posted on 2001-06-20
5
242 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
github account with ecipse 1 47
custom annotations 9 38
print map entry 34 67
by zero exception 10 39
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

786 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