I'm new in this forum and I was hoping that maybe some of you guys could help understand why this is happening.

I have a WAR file deployed on WebSphere Portal 8, it has some portlets with JSPs inside.

Now, the JSPs construct a String to make an URL, referring to an IFRAME. It does this by taking some fixed URL from a properties file. This cannot be, it has to be relative.

Now, using request.getRequestURL() always returns null. The method request.getServerName() returns a name that simply does not load on any browser, I guess because of the DNS. Anyway, it sucks because I just want what javascript document.URL would give me, but I don't have a way to put a form and a hidden field because there would be no submission action nor a form.

Any advice or ideas on why requestedURL is always null? And of course, any advice on how to do this?

Here's the JSP inside the WAR:

Java Code:
<%@ page import="java.util.*" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>


function returnURL()
	return window.location;
function wps_PokeTheSession()
	if ( window.frames['wps_BackgroundRefresher'] ) 

<a href="<portlet:renderURL><portlet:param name="viewpage" value="strategy">
            </portlet:param></portlet:renderURL>">Escoger una estrategia</a>


Properties props = new Properties();

String stro = "";

String url = props.get("smartFormsURL")+"?tenant="+request.getParameter("tenant")+"&strategy="+request.getParameter("strategy")

<iframe src="<%=url %>" width="100%" height="900" frameborder="0" name="sfiframe" id="sfiframe">
  <p>Your browser does not support iframes.</p>
<iframe name="wps_BackgroundRefresher" width="0" id="wps_BackgroundRefresher">