on 02-26-2009 3:01 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.