2 Replies Latest reply on Apr 4, 2006 1:01 PM by Mo Hay

    Determine current URI from portlet?

    Mo Hay Newbie


      I'm trying to determine which page a portal user is currently on by using the following jsp statements:

      String currentPage = request.getRequestURI();
      if (currentPage.indexOf("News") == -1) {
       ... do some stuff
      } else {
       ... do some other stuff

      Unfortunately, getRequestURI() returns the page that the portlet is consuming, in this case, /jsp/news.jsp.

      Is there a way that I can determine what the current page is? For the news page, it should be http://host/portal/blah/blah/News. The reason I need this is because I want to reuse my news portlet on multiple pages and display certain information depending on which page the portlet is on.

      Thanks in advance.