Uploaded image for project: 'Click'
  1. Click
  2. CLK-429

Move ClickServlet jsp to htm extension conversion to Page.setRedirect()

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.5 RC1
    • Component/s: core
    • Labels:
      None

      Description

      http://article.gmane.org/gmane.comp.web.click.user/2515

      I am trying out Click 1.4.2 in a web app that has existing legacy jsp pages. In particular situations, I need to redirect from a click page to one of these jsp pages. For example, in MyPage:

      public boolean onSecurityCheck() {
      setRedirect("/jsp/legacy.jsp");
      return false;
      }

      This results in a redirect to "http://myhost/context/jsp/legacy.htm".

      ClickServlet.processPage() performs a hard-wired conversion of "/jsp/legacy.jsp" to "/jsp/legacy.htm". This was added I think by CLK-338. In my case, I have no intention of using jsp with click servlet, so I would prefer that this conversion be optional.

      My workaround is:

      String contextPath = getContext().getRequest().getContextPath();
      javax.servlet.http.HttpServletResponse response = getContext().getResponse();
      String url = response.encodeRedirectURL(contextPath + "/jsp/legacy.jsp");
      try

      { response.sendRedirect(url); }

      catch(java.io.IOException e)

      { throw new RuntimeException(e); }

      setPath(null);

      Anyone see any issues with this?

      Would it be tough to make the "jsp" to "htm" conversion be configurable?

      From Bob:

      We can move the conversion logic to Page#setRedirect method. That way its easier to overload or subclass.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        I think we can resolve this for RC1 as it won't affect public API.

        Show
        sabob Bob Schellink added a comment - I think we can resolve this for RC1 as it won't affect public API.
        Hide
        sabob Bob Schellink added a comment -

        fixed in trunk will be available for 1.5-RC1

        Show
        sabob Bob Schellink added a comment - fixed in trunk will be available for 1.5-RC1

          People

          • Assignee:
            sabob Bob Schellink
            Reporter:
            dballard David Ballard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development