• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JSP and System properties.

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Saloon Keeper
Posts: 28753
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
why???
______________________________________________________________
class win{
public static void main(String args[]){
String sys = System.getProperty("user.name");
System.out.println(sys);
}
}
PRINTS CORRECTLY MY user name.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic