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

Page.setRedirect problem?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5 RC2
    • 1.5 RC3
    • None
    • None

    Description

      Hi, since the setRedirect logic was moved to the Page control...
      we must validate to guarantee that the "contextPath" will not be appended to the url twice.

      if you call setRedirect() two times (i know it´s strange but it´s possible), it will duplicate the contextPath...

      This is how I fixed this for my app:

      /**

      • @see net.sf.click.Page#setRedirect(java.lang.String)
        */
        public void setRedirect(String location) {
        if (location != null) {
        if (location.charAt(0) == '/')
        Unknown macro: { Context context = getContext(); String contextPath = context.getRequest().getContextPath(); if(!location.startsWith(contextPath)){ location = contextPath + location; } }

        }
        redirect = location;
        }

      Attachments

        Activity

          People

            sabob Bob Schellink
            rlecheta Ricardo R. Lecheta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: