Tapestry
  1. Tapestry
  2. TAPESTRY-1671

Need a way to redirect to external URLs

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.8
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The ability to create an ExternalLink to return from event methods for redirection is needed.
      ComponentResourcesCommon provides for creation of ActionLink or PageLink Links, but not external (non-Tapestry) links.

      The current ways around this are using LinkImpl (which is internal) or writing a custom implementation of Link.

      Cheers,
      Nick.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        You can now return a java.net.URL to force a client-side redirect.

        Show
        Howard M. Lewis Ship added a comment - You can now return a java.net.URL to force a client-side redirect.
        Hide
        Massimo Lusetti added a comment -

        Indeed. Mine were argument against LinkImpl usage for this kind of service.

        Show
        Massimo Lusetti added a comment - Indeed. Mine were argument against LinkImpl usage for this kind of service.
        Hide
        Nick Westgate added a comment -

        I don't think ActionResponseGenerator is a necessary return type when we already have Link.
        Using LinkImpl is the lazy unsafe way, but creating an ExternalLink that implements Link is the best way to go.

        Cheers,
        Nick.

        Show
        Nick Westgate added a comment - I don't think ActionResponseGenerator is a necessary return type when we already have Link. Using LinkImpl is the lazy unsafe way, but creating an ExternalLink that implements Link is the best way to go. Cheers, Nick.
        Hide
        Massimo Lusetti added a comment -

        Yes, using an ActionResponseGenerator as a return object type (or supertype) for redirecting the user to external link/resource.
        It's not even an internal API so i guess contributing an ExternalLinkActionResponseGenerator it's even better then to use LinkImpl.

        All this till some sort of "external link" is implemented or added on top of current Link API.

        I'm using this tecnique toghether with activation page context inside a distributed web application where every node comnicate with each other trhough http service calls.

        Why you conside this more dangerous then implementing an internal class?

        Regards
        Massimo

        Show
        Massimo Lusetti added a comment - Yes, using an ActionResponseGenerator as a return object type (or supertype) for redirecting the user to external link/resource. It's not even an internal API so i guess contributing an ExternalLinkActionResponseGenerator it's even better then to use LinkImpl. All this till some sort of "external link" is implemented or added on top of current Link API. I'm using this tecnique toghether with activation page context inside a distributed web application where every node comnicate with each other trhough http service calls. Why you conside this more dangerous then implementing an internal class? Regards Massimo
        Hide
        Nick Westgate added a comment -

        Do you mean using this inside an event handler? This sounds dangerous.
        I think it's best to use a standard paradigm (e.g. return a Link) to delegate to the framework.
        If this isn't what you meant, can you supply an example?

        Cheers,
        Nick.

        Show
        Nick Westgate added a comment - Do you mean using this inside an event handler? This sounds dangerous. I think it's best to use a standard paradigm (e.g. return a Link) to delegate to the framework. If this isn't what you meant, can you supply an example? Cheers, Nick.
        Hide
        Massimo Lusetti added a comment -

        Did anyone investigate the use of ActionResponseGenerator?

        Show
        Massimo Lusetti added a comment - Did anyone investigate the use of ActionResponseGenerator?

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Nick Westgate
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development