cancel
Showing results for 
Search instead for 
Did you mean: 

System Alias

Former Member
0 Kudos

I have two Web Dynpro applications which connect to the local server for some reason.

The first gets a custom stylesheet and has a properties file that has the following code:

sap-cssurl=http://max-sap49:50000/webdynpro/resources/sap.com/tcwddispwda/global/SSR/themes/tool_theme

The second connects to the database and has the following code:

Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@max-sap49:1533:PS2","username","password");

The problem is that we transport code from a Dev Server to a QA server to a Production Server which all have different 'names' (max-sap49, max-sap:53, max-sap:55). Is there anyway I can create an alias for all servers so that I don't have to touch the code when deploying to a new server?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can retrieve the server name and port at runtime and build the string dynamically. Something like this:


String serverNameAndPort = (String)AccessController.doPrivileged(new PrivilegedAction(){
   public Object run() {
	IWDRequest request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
	return (request.getServerName() + ":" + request.getServerPort());
   }
});

String cssURL = String.format
("http://%s/webdynpro/resources/sap.com/tc~wd~dispwda/global/SSR/themes/tool_theme",
 serverNameAndPort);

You can do the same for the connection parameters also; you'll need only the server name.

Regards,

Satyajit

Answers (0)