Hello!
I'm using OpenEMM 2013 on Windows Server 2008 and now I discover, that redirect page doesn't work. If I try to click on a link, only internal link like http://<ip_address>:8080/r.html?uid=1.d.n.1z.p4jn50ebmi appears at the browser without redirect. OpenEMM is available on the link http://<ip_address>:8080. Links in the database look well.
Have anyone ideas what is wrong?
One qualification: OpenEMM fixes the fact of clicking a link. I can see the records in database. But no redirection appears. May be it is a problem of Tomcat?
Redirect doesn't work
Moderator: moderator
Re: Redirect doesn't work
Problem was resolved. I'm not a java programmer, but it's seems to me that the following code in rdir.java sometimes doesn't work properly:
I've checked http response of redirect page and discovered, that the status hasn't been returned, but header "Location" has been added:
HTTP/1.1 0 OK
Server: Apache-Coyote/1.1
Location: http://<link>
Transfer-Encoding: chunked
Date: Fri, 27 Feb 2015 17:25:17 GMT
So my hypothesis is that condition doesn't work properly in my case, because header "Location" is added in the "else" branch.
Then I'd tried to comment key redirection.status=302 in emm.properties and redirect started to work. Is my hypothesis correct?
The absence of the key redirection.status=302 generates error
but it is not critical for me.
Code: Select all
if (AgnUtils.getDefaultValue("redirection.status") == null || AgnUtils.getDefaultIntValue("redirection.status") == 302) {
res.sendRedirect(fullUrl);
// res.sendRedirect(aLink.getFullUrl());
} else {
res.setStatus(AgnUtils.getDefaultIntValue("redirection.status"));
res.setHeader("Location", fullUrl);
res.flushBuffer();
}
HTTP/1.1 0 OK
Server: Apache-Coyote/1.1
Location: http://<link>
Transfer-Encoding: chunked
Date: Fri, 27 Feb 2015 17:25:17 GMT
So my hypothesis is that condition
Code: Select all
AgnUtils.getDefaultValue("redirection.status") == null || AgnUtils.getDefaultIntValue("redirection.status") == 302
Then I'd tried to comment key redirection.status=302 in emm.properties and redirect started to work. Is my hypothesis correct?
The absence of the key redirection.status=302 generates error
Code: Select all
2015-02-27 22:20:21,591: ERROR [http-8080-1] org.agnitas.util.AgnUtils - getDefa
ultValue: Can't find resource for bundle java.util.PropertyResourceBundle, key r
edirection.status