cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Cloud Commerce, Problem with URLs in Form: ${originalContextPath}/${MyResourcePath}

volkerb
Discoverer
0 Kudos
264

We have some custom pages in our SAP CC which make use of URLs in similar form as below:

<img src="${originalContextPath}/${MyImagePath}">

While the generated URL is as expected running on-premise, it does not look good while running in the cloud.

Given that ${MyImagePath} is "/_ui/responsive/images/mypic.png" we observe two different resulting URLs:

URL On-Premise: "/_ui/responsive/images/mypic.png"

URL in the cloud: "//_ui/responsive/images/mypic.png"

Notice the additional leading slash in the URL in the cloud, which leads to an invalid URL.

Our storefront configuration in manifest.json looks as follows:

    {
      "name": "accstorefront",
      "properties": [
        {
          "key": "spring.session.enabled",
          "value": "true"
        },
        {
          "key": "spring.session.mystorefront.save",
          "value": "async"
        },
        {
          "key": "spring.session.mystorefront.cookie.name",
          "value": "JSESSIONID"
        },
        {
          "key": "spring.session.mystorefront.cookie.path",
          "value": "/"
        },
        {
          "key": "storefrontContextRoot",
          "value": ""
        }
      ],
      "webapps": [
        {
          "name": "mediaweb",
          "contextPath": "/medias"
        },
        {
          "name": "mystorefront",
          "contextPath": ""
        },
        {
          "name": "acceleratorservices",
          "contextPath": "/acceleratorservices"
        },
        {
          "name": "smartedit",
          "contextPath": "/smartedit"
        },
        {
          "name": "cmssmartedit",
          "contextPath": "/cmssmartedit"
        }
      ]
    },

What do we need to consider in addition, in order to fix this problem? Any help is highly appreciated.

Accepted Solutions (0)

Answers (0)