Avatar of aaaaaa
aaaaaa
 asked on

how to get websphere port number

i am using websphere application server 5.1.2
i set my 2 application port as 9080, and 9081

in my java code, how can i get the current running application port?
Java App Servers

Avatar of undefined
Last Comment
HonorGod

8/22/2022 - Mon
HonorGod

Please provide more information.

You want a Java Application that is running on a WebSphere JVM to determine
the port number that was used to access the resource.  Is this correct?
aaaaaa

ASKER
i got a java application, this is to get the port number of websphere application.
but how to get?
HonorGod

I'm sorry, I must not have been clear enough with my question.

Are you asking:

How should a Java application running on a WebSphere Application Server determine the port number being used?

Your help has saved me hundreds of hours of internet surfing.
fblack61
HonorGod

If this is the case, you need to look into the available on-line documentation that talks about developing Administrative programs in Java.

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welcadminprogram.html

You probably will want to investigate the section entitled:
Create a custom Java admininstrative client program using the Java administrative APIs
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//topic/com.ibm.websphere.base.doc/info/aes/ae/tjmx_customjava.html

Is this what you want/need?
aaaaaa

ASKER
firstly
when a WebSphere Application Server run,
we can access it by
http://127.0.0.1:9080/myweb or
http://127.0.0.1:9081/myweb  right?

so now my question, my servlet or any java class, how do i know which one above is running?
ASKER CERTIFIED SOLUTION
HonorGod

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.