0

Machine and user name

asked 2010-08-05 01:50:53 +0800

din gravatar image din
251 1 5

Can I get the name of the machine from where my application is getting accessed in the zkoss framework?
Please share if anybody has used this feature.

Thanks,Dino

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2010-08-05 03:00:11 +0800

samchuang gravatar image samchuang
4084 4

Hi

the name of the machine ? Can you explain more detail ? What kind of name ?

link publish delete flag offensive edit

answered 2010-08-05 03:48:07 +0800

din gravatar image din
251 1 5

Basically what I want is to know the name or IP address of the machine from where the user is accessing my application so that I can provide the customization option to the user to make its own homepage by setting the selected home page as cookie alongwith the IP address.
Do you have any idea how can I provide the user with this customization option by any ohter way?

link publish delete flag offensive edit

answered 2010-08-05 05:54:12 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

updated 2010-08-05 05:54:25 +0800

Hi,

you can try to use Executions.getCurrent().getRemoteAddr() and Executions.getCurrent().getRemoteHost() (both methods are delegates from ServletRequest):

More info here:

http://docstore.mik.ua/orelly/java-ent/servlet/ch04_03.htm

Cheers, Maik

link publish delete flag offensive edit

answered 2010-08-05 07:05:20 +0800

din gravatar image din
251 1 5

Hi Maik, I tried this but it gives me the machine name where the application is deployed i.e. server.
any other way I can do it?

Thanks, Dino

link publish delete flag offensive edit

answered 2010-08-05 08:23:15 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Do you run your application-server behind a HTTP-Server like Apache or a Proxy? If so, you have to look if the HTTP-Server/Proxy adds a X-Forwarded-For-Header to the request:

http://en.wikipedia.org/wiki/X-Forwarded-For

Cheers, Maik

link publish delete flag offensive edit

answered 2010-08-05 23:56:47 +0800

din gravatar image din
251 1 5

Hi Maik, my application runs on tomcat server. Is there anyway I can get the IP address of the accessing machine?

Thanks,Dino

link publish delete flag offensive edit

answered 2010-08-10 11:31:30 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

Maybe u can use the log of Tomcat to get the access ip...
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve

%a - Remote IP address

link publish delete flag offensive edit

answered 2010-08-10 15:05:36 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

If you work with spring-security you can get it from the Authentication Object.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-08-05 01:50:53 +0800

Seen: 794 times

Last updated: Aug 10 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More