Hi.

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" %>

<portlet:defineObjects/>

<script>
function returnURL()
{
	return window.location;
}
function wps_PokeTheSession()
{
	if ( window.frames['wps_BackgroundRefresher'] ) 
	{
		window.frames['wps_BackgroundRefresher'].location=window.frames['wps_BackgroundRefresher'].location;
	}
}
setInterval("wps_PokeTheSession()",3540000);
</script>

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

<br/>
<br/>

<% 
Properties props = new Properties();
props.load(this.getClass().getClassLoader().getResourceAsStream("properties/DecisorPortlets.properties"));

String stro = "";

String url = props.get("smartFormsURL")+"?tenant="+request.getParameter("tenant")+"&strategy="+request.getParameter("strategy")
	+"&strategyId="+request.getParameter("strategyId")+"&tenantId="+request.getParameter("tenantId")
	+"&nitType="+request.getParameter("nitType")+"&userId="+request.getParameter("userId")
	+"&userIdType="+request.getParameter("userIdType")+"&userFullName="+request.getParameter("userFullName")
	+"&submissionId="+(request.getParameter("submissionId")!=null?request.getParameter("submissionId"):"");
	
%>
<%=request.getScheme()%>

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