0 Replies Latest reply on Mar 5, 2007 12:23 AM by Edward Chen

    renderURL stuff -  URL navigation inside portlet

    Edward Chen Newbie

      I am developing a JSP portlet application under uPorta (JSR 168 portlet). The portlet has 3 pages - view.jsp, view1.jsp, and view2.jsp. Now I know how to go view.jsp (actionURL)from view1.jsp, and from view1.jsp (renderURL) back to view.jsp.

      Now I have a task that I don't know how to do it. There is a URL link in view1.jsp as below

      ......


      <%=MyIP%>


      ........

      Now I want to go to view2.jsp when a click on the above link. But the problem is when a click on above link, it bring me back to the first page view.jsp, not view1.jsp

      Can you tell me how to do pages with URL navigation inside portlet? Sample code please if you can provide

      here is my doview function. The problem is when I subcribe my portlet, it first automaitcally go to view3.jsp, not from view.jsp to view2.jsp then view3.jsp

      protected void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException, UnavailableException {

      response.setContentType("text/html");

      String MyEndDate = request.getParameter("EndDate");
      String MyNetworks = request.getParameter("networks");

      String MyYourName = request.getParameter("yourname");

      PortletURL actionURL = response.createActionURL();
      actionURL.setPortletMode(PortletMode.VIEW);
      request.setAttribute("actionURL", actionURL.toString());

      PortletURL renderURL = response.createRenderURL();
      renderURL.setPortletMode(PortletMode.VIEW);
      request.setAttribute("renderURL", renderURL.toString() );

      if(MyEndDate!= null )

      {
      PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view2.jsp");
      prd.include(request, response);
      }
      else if (renderURL.toString()!=null)
      {
      PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/view3.jsp");
      rd.include(request,response);
      }

      else
      {
      PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view.jsp");
      prd.include(request, response);
      }

      }


      Hope the above code you can know what's wrong