Uploaded image for project: 'Pluto'
  1. Pluto
  2. PLUTO-648

Unable to get IllegalArgumentException while using relative path in sendRedirect method in processAction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.0-M3
    • 3.0.0
    • portlet container

    Description

      Failing test case:

      1) V2AddlResponseTests_SPEC2_12_Action_redirect1 - If a relative path is supplied to the sendRedirect method, an IllegalArgumentException must be thrown

      Problem -
      1) If I start the path from ../ or ./ , pluto reads it as 3/ or 4/ respectively.
      2) If I start the path from / , pluto considers it as full path which is allowed.

      Observed behavior - We get ServletException with root cause NumberFormatException. Below is the stack trace of the same

      exception

      javax.servlet.ServletException: Cannot handle request for portal URL. Problem: For input string: "3/V2AddlRequestTests"
      org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:130)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      root cause

      java.lang.NumberFormatException: For input string: "3/V2AddlRequestTests"
      java.lang.NumberFormatException.forInputString(NumberFormatException.java:77)
      java.lang.Integer.parseInt(Integer.java:504)
      java.lang.Integer.parseInt(Integer.java:539)
      org.apache.pluto.driver.url.impl.PortalURLParserImpl.parse(PortalURLParserImpl.java:248)
      org.apache.pluto.driver.core.PortalRequestContext.getRequestedPortalURL(PortalRequestContext.java:119)
      org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:126)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

      Expected behavior - We should get IllegalArgumentException on using relative path.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mahmedk91 Ahmed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: