- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 02:09 PM
We have a custom widget that is used on our service portal like a custom icon widget I would say. When the portal loads I notice the following errors in the logs:
Error while fetching the host of the URL : https://XXXX.service-now.com/{{i.icon}}: java.net.URISyntaxException: Illegal character in path at index 32: https://XXXX.service-now.com/{{i.icon}}: java.base/java.net.URI$Parser.fail(URI.java:2913)
The issue seems to be in the setup of the HTML even though the widgets work, these errors get generated daily when people visit the page.
Please see screenshots below. I think the issue is with the pull of the "icon" image from the lookup table which would be like 9493939393939.iix and then used in the URL.
Any thoughts to what may not be coded correctly in the html?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 08:45 AM - edited ‎01-04-2024 08:47 AM
@k_lutz ,
I see the issue in {{i.icon}}. Can you change it to "{{i.icon}}".
Next we will check if URL encoding is needed. But can you try above once.
Mark helpful if this helped.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 02:54 PM
@k_lutz ,
I have similar images on my portal.
What I do to get the image right is I dot walk to the image field on the glideRecord object.
Below is your code, I am assuming that the u_image field is an image type field on your table.
vr.u_image+'.iix'
Please mark helpful, if this helped.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 05:16 AM
Thanks for the suggestion. I am currently getting the image. I tried your code and it also gets the image.
The issue is that it works but in our log file it will generate the following:
Error while fetching the host of the URL : https://xxxx.service-now.com/{{i.icon}}: java.net.URISyntaxException: Illegal character in path at index 32: https://xxxx.service-now.com/{{i.icon}}:
I think it has something to do with the way the URL information is coming back or being used in the HTML section but not sure what is not setup correctly. The person who created this widget did so several years ago and is no longer here...but we get these errors daily. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 08:45 AM - edited ‎01-04-2024 08:47 AM
@k_lutz ,
I see the issue in {{i.icon}}. Can you change it to "{{i.icon}}".
Next we will check if URL encoding is needed. But can you try above once.
Mark helpful if this helped.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 11:21 AM
Thanks for the assistance. I used your suggestions and played with the server script and the HTML and got the following to work without showing that parsing error in the system log:
in the HTML:
<img ng-src="{{::i.icon + '.iix'}}" alt=""/>
in server script:
items.icon = vr.getValue('u_image');