Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-1111

A space in the context path causes PageFlowUtils.getActionURI() to throw a URISyntaxException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0, 1.0.1, 1.0.2
    • 1.0.2
    • NetUI
    • None

    Description

      If you create a NetUI web application and deploy it with a servlet context name that includes a space ("/test space"), then any pages that use tags that rewrite of an action name will throw a URISyntaxException.

      The problem occurs because in our MutableURI implementation we use java.net.URI() to parse a string into the components of the URI. The java.net.URI constructor with a single argument expects the string to be encoded. A space in the string causes it to throw URISyntaxException.

      Unfortunately, the real issue in this bug is the difference in what is returned from a call to request.getContextPath(). The implementation for HttpServletRequest method getContextPath() is not consistent across containers. The spec says the "container does not decode this string." However, the string returned in Tomcat is decoded. (See Tomcat bugzilla bug 39503) Also this method returns a decoded string in some containers if the request is a forward where the RequestDispatcher was acquired using a relative path.

      We build a path based on the result of getContextPath() and the module path for the current page flow. When we get a decoded space in the context path, we get the exception described above. It seems that it is only the space character in the context path that causes us issues so we can check for a decoded space in the context path and encode it.

      Attachments

        Activity

          People

            jzhuo Julie Zhuo
            crogers Howard Carlin Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: