on 08-06-2009 4:51 PM
Hi,
How to get Application server Environment information into my application.
for example my application need to behave differently in DEV, TEST,PROD with values defined according to the environment
where it is deployed.
Please help me out from this.
thanks
Hi,
Check these API's of WDProtocolAdapter.
String serverName = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getServerName();
int serverport = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getServerPort();
String hostAddress = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress();
String hostName = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName();
Once you have the name of the server with yiu then you can decide upon the code logic according to your requirement.
I hope this helps you!! Please revert back in case you need nay further information.
Thanks and Regards,
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Pravesh,
The code you have given is working fine. but i want a little specific about the server where iam going to deploy.
Like , is there any parameter will be declared in the server which will get whether it is a DEV server or TEST server or PROD server.
What iam getting from the code you have given is like below
Server Name:_xdev.sap.www.abcd.com_
thanks
Hi,
If your WebDynpro for Java Application is running in an iView, you can always add an application parameter like RUN_SYS=DEV in the iView attributes and read this parameter in your application.
IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String mySys = req.getParameter("RUN_SYS");
if (mySys.equalsIgnoreCase("DEV")) {
/* Do your stuff */
}
Hope this helps a little.
Regards,
Alain
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.