I have a reactive application.
When try to access URL like below:https://{URL_APP}?param=N5dnw7%%2F8ozUoLAfjefiCcTDV8HimtJokHCYTq%2BUiMZpIN1baEaGiBUkPH40HsmWeZU%3D
The error happen and the web page display white - blank. How can I handle this error?
In case a user intentionally enters the wrong URL and causes an error to occur, how to handle it?
Hi,
The issue arises due to the encoding of the URL parameters. Special characters like % and = might be incorrectly encoded or decoded, leading to the blank page.
You can use EncodeUrl().
Thanks,
Vipin Yadav
You can pass url like below -
"https://{URL_APP}?param="+EncodeUrl(param)
Thank you.
But do you have example OML?This error happen in Navigation.js of Outsystems. So I can't check it in onInitialized or onRender event of the screen.
Thanks,Phuc
Hi @PhucHoang,
If possible, please share your OML file so that I can make the necessary changes and update you.
OK.Let me share the OML.
The invaid URL: https://{URL}/DemoAPp/Home?Id=N5dnw7%%2F8ozUoLAfjefiCcTDV8HimtJokHCYTq%2BUiMZpIN1baEaGiBUkPH40HsmWeZU%3D
The error with encoding the given string (Id=N5dnw7%%2F8ozUoLAfjefiCcTDV8HimtJokHCYTq%2BUiMZpIN1baEaGiBUkPH40HsmWeZU%3D) occurs because the string contains invalid or double-encoded characters that are causing issues during the encoding or decoding process. Specifically, the %% is problematic because it's neither a valid encoded value nor an acceptable character for URLs.
Thanks for your reply,
It seems you are misunderstanding my point. I have attached the recording of the issue that I need to resolve. When intentionally accessing an incorrect URL, an error occurs. I want to display a more user-friendly error message or something similar.
Hi @Vipin Yadav , do you have any solution to resolve it?Thanks,
No, Brother. It seems there is an issue with the encoding or decoding process. Maybe other community members can assist you with this.
Hi @PhucHoang
The error occurs when the decodeURIComponent() function in JavaScript is called on a URL-encoded string that is not properly encoded or contains invalid characters.
The main cause of the URI malformed error is likely due to double encoding in the URL parameter. Implementing double decoding, using safe decoding methods, and ensuring that URLs are properly encoded can help resolve this issue and prevent the page from failing silently with a blank screen.
%%2F appears in your URL may be the reason, as it might indicate double encoding. This could be the root cause of the error.
If the URL parameter is being double-encoded, the solution is to decode it twice.
Regards ,
Rajat
HI @Rajat Agrawal