This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Websphere and the fly likes Getting Was node's name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting Was node Watch "Getting Was node New topic
Author

Getting Was node's name?

mik laan
Greenhorn

Joined: Sep 04, 2002
Posts: 29
Hello,
I have a clustered environment with multiple Was instances and clones.
Are there any Was related java class, JNDI entry or system property
(System.getProperty()) that could be used in my java applicalition to tell in which node my application is running?
Thanks,
Raj Varanasi
Greenhorn

Joined: Nov 20, 2001
Posts: 11
Hi,
Usually hostname will be node name for websphere in a clustered environment.You can use the following code(jsp code) to get the hostname in ur java application.This is for solaris environment.

<%@ page import="java.io.*"%>
<%
String command = "hostname";
Process p = Runtime.getRuntime().exec(command);
String s =null;
DataInputStream in = new DataInputStream(p.getInputStream());
while ((s = in.readLine()) != null) {
out.println("Hostname is: " + s);
}
%>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Was node's name?
 
Similar Threads
How to invoke a java class which is not an applet from the html page?
newbie needs tutorials on java
Difference between Event propagation & Event delegation
Dial Up Software Using Java
Informal poll: What are the most popular 1st languages?