I'm in the process of upgrading a Tridion 2013 SP1 HR1 based site to SDL Web 8.5. The current delivery environment is based on .jsp
files. I'm attempting to use the CIL libraries but I'm having trouble with the Component Link tag. The CIL is thowing 400 Bad Request Errors:
2017-04-10 16:02:39,771 DEBUG BasicEndpointCaller - Preparing the call endpoint for given url: http://10.215.21.21:8081/client/v4/content.svc/GetComponentLinkFunctionImport(PublicationId='7',SourcePageId='237',TargetComponentId='9385',ExcludeTemplateId='100528',LinkTagAttributes='',LinkText='%3Cimg+src%3D%22%2Fshowcase%2Fassets%2Fhome_rotator_bike-rentals_tcm7-307.jpg%22++class%3D%22img-responsive+home-image%22+alt%3D%22Feature+image+for+Home+headline+1%22+%2F%3E',ShowTextOnFail='true',ShowAnchor='true')
2017-04-10 16:02:39,787 DEBUG BasicEndpointCaller - Request ended with 400 status code.
The microservices are otherwise working as expected, some DCP tags are rendered properly earlier in the .jsp
page.
It is pretty obvious to me why I get this error, the url constructed for the content microservice call contains a lot of markup that came from the child img
tag within the Component Link (linktext
attribute) which make it an invalid url.
Here is the tag that is causing the error as it is rendered on the .jsp
page:
<tridion:ComponentLink pageURI="tcm:7-237-64" componentURI="tcm:7-9385" templateURI="tcm:7-100528-32" addAnchor="true" linkText="<img src="/showcase/assets/home_rotator_bike-rentals_tcm7-307.jpg" class="img-responsive home-image" alt="Feature image for Home headline 1" />" linkAttributes="" textOnFail="true"/>
I tried messing with the encoding to see if I could get it to go through but then I end up with encoded HTML which does not display properly in the browser.
Anyone have any thoughts? Is this not an appropriate use of the CIL? Do I need to go back to the deprecated in-process API role?
Thanks!