0

On a page i am redirecting the user to another page in the meta tag pf my page.

<meta HTTP-EQUIV="REFRESH" content="0; url=/abc/example" />

Now i want to add the current page url as a param to the redirect url so that it becomes

url = '/abc/example?prevUrl=currentPage.html'

I am using jstl tags, trying something like

<c:url value = "/abc/example" var="myURL">
    <c:param name="prevUrl" value = document.URL/>
</c:url>

<meta HTTP-EQUIV="REFRESH" content="0; url='${myURL}'" />

But obviously im doing something wrong. Please help. Or any other way to add a param to my redirect url???

ghostCoder
  • 7,009
  • 8
  • 43
  • 63

1 Answers1

0

In your servlet put the URL on the request like this:

request.setAttribute("myUrl", "/abc/example?prevUrl=currentPage.html");

Then you can just put it in the meta tag using an EL expression like this:

<meta HTTP-EQUIV="REFRESH" content="0; url='${myUrl}'" />
clav
  • 4,073
  • 25
  • 39