on 04-10-2006 5:09 AM
How can I get my application Context Path via webdynpro code?
Let say I'm accesing my application with URL
https://myapp:8443/webdynpro/dispatcher/local/MyApp/App, how can I get
the value 'https://myapp:8443' from webdynpro code? In J2EE, this is
equivalent of HttpServletRequest.getContextPath() method. Do we have
this method call in webdynpro object?
Hi John,
Yes you can achieve that in Web Dynpro.
Try the following -
// USE THIS FOR GETTING THE SERVER NAME AND IMPORT WEBLOGIC.JAR FILE IN THE JAVA BUILD PATH PROPERTIES
HttpServletRequest request = (( com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
//GETS THE HOST NAME OF THE SERVER
String strHostName = request.getServerName();
Thanks,
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
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.