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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4.2
    • 1.5 RC1
    • core
    • 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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: