Fetching server name and port number for ADF application

Requirement – How to get server name and server port.
Solutions- You can get this information in by writing below code in java

FacesContext fctx = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) fctx.getExternalContext ().GetRequest ();
String serverName = request.getServerName();
int serverPort =request.getServerPort();

System.out.println ("Server Name:" + serverName);
System.out.println ("Server Port no:" + server port);

Happy coding with Vinay Kumar in Techartifact.

Get intradoc Server port in custom component in Webcenter Content (UCM)

Requirement – How to get intradoc server port in custom component in Webcenter Content.

Solution – We can use one class called sharedObject which give us environment value.One of my friend(Jonathan) helped me in this.

use SharedObjects.getEnvironmentValue(“IntradocServerPort”) will give you intraDocServer port.

SharedObjects.getEnvironmentValue("IntradocServerPort");

Read more on http://jonathanhult.com/intradoc-api/intradoc/shared/SharedObjects.html

Quick tip in end of weekend
Happy coding with Vinay Kumar in Techartifact.