1 Reply Latest reply: Jul 24, 2013 12:08 PM by rush_pawan RSS

    Broken Link handling by CQ

    Veena_07 Community Member

      Hi

       

          I am taking a link from user and setting it in <a href ="<c:url value="${titleLink}"/>"  target="_blank"></a> . But for me anything starting with http:// or https:// is a valid link. But if I give only http:// or https:// it is giving me a broken link in my page . The same is not happening with some other components. Can i know if CQ itself handles this or not

       

      Thanks

      Veena

        • 1. Re: Broken Link handling by CQ
          rush_pawan Community Member

          Hi Veena,

           

          CQ validates links of resource which are relative to current respository either you use relative or full url. It does not validate any outside url and i am not sure if there is any OOTB configuration to check that too. The case you have mentioned above is not actually a url because its not complete (either local or outside)

           

          The <c:url> just format the url with proper encoding.

           

          I suggest to use <%xssAPI.getValidHref(link)%> to validate all the links that you display on page (its implicit object once you include /libs/foundation/global.jsp on your page) or

           

          Let me know if you need more information.

           

          Thanks,

          Pawan