Home
Analytics
Hide report parameters in URL
hallj05
<p>Hey,</p>
<p> </p>
<p>We are using the <span>Open Source </span>version of BIRT 4.2.2 and the BIRT Report Viewer.</p>
<p> </p>
<p> </p>
<p>When we go from one report to another and pass report parameters they are being added to the URL.</p>
<p> </p>
<p>something like this is added onto the url if the report parameter was 'user'</p>
<p>user=admin</p>
<p> </p>
<p>Is there a way to pass the report parameter but not show it in the url? Or a way to make it so that the URL is not editable by the user.</p>
<p> </p>
<p> </p>
<p>Since at the moment the user can change the report parameters in the URL and make it so that they can have access to reports/data that they should not be able to see.</p>
<p> </p>
<p>Thanks!</p>
Find more posts tagged with
Comments
kclark
<p>You can do one of two things, you can either your session variables to store the parameter values. Then using some scripting, populate your hidden parameters with the values from your session variables.</p>
<p> </p>
<p>Or, as a quick fix you could modify the URL in the browser without reloading it using something like this (untested)</p>
<pre class="_prettyXprint _lang-">
function processAjaxData(response, urlPath){
document.getElementById("content").innerHTML = response.html;
document.title = response.pageTitle;
window.history.pushState({"html":response.html,"pageTitle":response.pageTitle},"", urlPath);
}
</pre>
<p>Or you could hide the address bar of the browser using some JS</p>
Elizabeth_Keen
<p><span>you should be able to do a form post to the url to hide parms. You<br>
may also want to look at the new tag libs like:<br><br>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"<br>
pageEncoding="ISO-8859-1"%><br>
<%@ taglib uri="/birt.tld" prefix="birt" %><br>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br>
"<a data-ipb='nomediaparse' href='
http://www.w3.org/TR/html4/loose.dtd'>http://www.w3.org/TR/html4/loose.dtd</a>"><br>
;
<html><br>
<head><br>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><br>
</head><br>
<body><br>
<birt:report id="birtViewer" reportDesign="TopNPercent.rptdesign"<br>
height="600"<br>
width="800"<br>
format="html"<br>
reportContainer="div"<br>
isHostPage="false"<br>
><br>
<birt:param name="Top Count" value="3"></birt:param><br>
</birt:report><br>
</body><br>
</html></span></p>
<p> </p>
<p><span>For Web Apps visit <a data-ipb='nomediaparse' href='
http://www.ati-erp.com'>http://www.ati-erp.com</a></span></p>
;
hallj05
<p>Thanks kclark and Elizabeth_Keen</p>
<p> </p>
<p>I got it to do what I want using the session variables.</p>
<p> </p>
<p>Setting the value via:</p>
<p>reportContext.getHttpServletRequest().getSession().setAttribute("name", "value")</p>
<p> </p>
<p>Getting the value via:<br>
reportContext.getHttpServletRequest().getSession().getAttribute("name")</p>