cancel
Showing results for 
Search instead for 
Did you mean: 

Get Server Name from inside an EJB

lauraquinterosa
Participant
0 Kudos

Hi gurus!

I have the following question...is it posible to retrieve the server name from an EJB?

This EJB is called via a WebService Proxy from a KM Scheduler Service (PAR project).

But I need to know at EJB-level the server I'm working with.

Thanks in advance!

Regards,

Laura

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

in servlet how to get servername is below code

(

HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException {

String servername;

servername = request.getServerName();

but dont have any idea how to get in EJB.

jayesh talreja

Vlado
Advisor
Advisor
0 Kudos

ServletRequest.getServerName() will give you the host name of the server to which the request was sent.

I'm not sure if this is what is required in Laura's scenario, or if it is the name of the system a.k.a. SID (e.g. J2E, DEV, TST, PRD - you got the picture). If it's the latter, you can get it as in my example above; if the former, it's not possible to obtain that kind of information from within an EJB.

Regards,

\-- Vladimir

Vlado
Advisor
Advisor
0 Kudos

Hi Laura,

String systemID = System.getProperty("SAPSYSTEMNAME");

HTH!

\-- Vladimir