wood burning stoves
The moose likes Servlets and the fly likes JSP and System properties. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP and System properties." Watch "JSP and System properties." New topic

JSP and System properties.

vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
well this is my small bean which is supposed to get the system user name in my jsp page but what happens is that every time my jsp page loads it gives an exeption that there is "no property associated with parameter systprop" im a bit confused about this!!! here is my code..
import java.lang.*;
import java.io.*;
import java.lang*;
public class Winuser {
String systprop= "bean" ;
public String getWinuse()
systprop = System.getProperty("user.name");
return systprop; }
WHAT IS THE PROBLEM IN MY CODE, according to bean specs it says that if the beam is used for read only then its enough that there is only one get method???

SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

It wouldn't have helped anyway. All you'd see is the user ID of your server login. This is a property of the local JVM.
Web users don't have user IDs unless they're authenticated, and even then the "user id" depends on what sort of authentication scheme you have. It's not like logging into a LAN.

An IDE is no substitute for an Intelligent Developer.
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
Wowwwww!!! mgnificient tim!! thats what is the difference between a novice like me and a experienced people like u!!
yes i got the same problem , it is giving me the root user name !!! Please tell me if javascript could work properly here to get the system user name! but this code works perfectly , with this code i get the user name correctly here goes my code..
The code below works fine but why not for jsp pages??
Tim as u said in jsp it gets the server log on???
class win{
public static void main(String args[]){
String sys = System.getProperty("user.name");
I agree. Here's the link: http://aspose.com/file-tools
subject: JSP and System properties.
It's not a secret anymore!