Jump to content

Help - Java Threads


panthulu

Recommended Posts

CJ, Inno...

 

Please help me with this too

 

I have this requirement now, can you pls suggest how to implement

 

We have our application deployed in a server hosting jboss service(s), I need to read that server name in our application. (Note we using spring)

 

 

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

  • cherlapalli_jailer

    18

  • panthulu

    14

  • innovative

    7

  • fake_Bezawada

    4

CJ, Inno...

 

Please help me with this too

 

I have this requirement now, can you pls suggest how to implement

 

We have our application deployed in a server hosting jboss service(s), I need to read that server name in our application. (Note we using spring)

 

server name is system property

 

very easy..if u want i will give the syntax.....but try ...

 

 

Link to comment
Share on other sites

InetAddress.getLocalHost().getHostName()

 

Bhayya this is returning my computer name.....I need the servername our app is deployed in.

normal ga ...server name is computer name..

 

if u run locally then it will return ur computer name

Link to comment
Share on other sites

CJ bhayya... Neeku java lo anni years exp?? Na lanti freshers ki nuvvey inspiration bhayya... Appatikaina nee anthati vadini avvalani asistuhnna...

you rock

bayyo.... neenu chaala takkuva..

 

inka inka inka paiki raavali

 

7Yrs vunnadi

Link to comment
Share on other sites

normal ga ...server name is computer name..

 

if u run locally then it will return ur computer name

nee application ekkada run ayithe Aa name return chestundi

Link to comment
Share on other sites

localhost is 127.0.0.1 is mapped to one host name

 

that is the name of that box or server

 

so it will return that name

Link to comment
Share on other sites

if you are trying to get application server name, where your application is deployed, try in servlet with this code:

 

String str1 = getServletContext( ).getServerInfo( );

 

:5_2_108:

Link to comment
Share on other sites

if you are trying to get application server name, where your application is deployed, try in servlet with this code:

 

String str1 = getServletContext( ).getServerInfo( );

 

:5_2_108:

  • GP

 

 

this also works..

Link to comment
Share on other sites

org.jboss.system.server.ServerInfo;

new ServerInfo().getHostName()

 

Finally used this to get the hostname which we do not need to handle an exception.

 

Thanks CJ... CITI_$D#

Link to comment
Share on other sites

CJ bhayya... Neeku java lo anni years exp?? Na lanti freshers ki nuvvey inspiration bhayya... Appatikaina nee anthati vadini avvalani asistuhnna...

you rock

@gr33d  sHa_clap4

Link to comment
Share on other sites

Mukunda,

 

We are using Spring but thanks for the input.  sHa_clap4  sHa_clap4

 

if you are trying to get application server name, where your application is deployed, try in servlet with this code:

 

String str1 = getServletContext( ).getServerInfo( );

 

:5_2_108:

 

Link to comment
Share on other sites

×
×
  • Create New...