nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

jar file unable to load local html file with url parameters #67

Open jamessspanggg opened 5 years ago

jamessspanggg commented 5 years ago

Hi, our project has a browser panel that loads local html files with url parameters in the form of "page.html?name=xxx&address=xxx...".

The loading of html files works fine when executing the main program in IntelliJ.

However, when we convert it into a jar file, it simply cannot load those files.

Any idea on how to solve this problem? Thanks.

jamessspanggg commented 5 years ago

to add on, when it loads a html file without parameters (page.html), it works fine, but when there are parameters (page.html?name=xxx&address=xxx), it doesn't load

kylase-learning commented 5 years ago

I'm not sure if it will help you but you mentioned you are trying to load local files. You might want to check the following:

jamessspanggg commented 5 years ago

The local files are in the correct directory because it is in the same directory as default.html, but loading default.html works fine since it does not include query strings. But whenever I try to load a html file with query string i.e. page.html?name=xxx etc, it doesn’t load.

leeyh20 commented 5 years ago

https://stackoverflow.com/questions/40199765/using-javafx-webengine-to-load-a-local-file-and-adding-parameters-to-the-url-no

Sounds similar to this problem. The person who posted the question tried to use other methods instead such as executeScript.

https://stackoverflow.com/questions/19420753/how-to-call-a-javascript-function-from-a-javafx-webview-on-button-click