You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Andy Turner <A....@leeds.ac.uk> on 2022/09/21 00:27:18 UTC

HTML5Application finding things from "/"

Hi,

I am trying to refer to files from an html file that is within a directory in the default public_html directory from /, but I can't seem to configure or get the addressing working as I want.

I have:

  1.  Created a new HTML5Application in Netbeans 15 on openJDK17.
  2.  Created a directory in public_html called test<http://localhost:8383/HTML5Application/test/index.html>, and a file in test<http://localhost:8383/HTML5Application/test/index.html> called index.html<http://localhost:8383/HTML5Application/test/index.html>.
  3.  Created a style.js<http://localhost:8383/scripts/style.js> file in the public_html directory.
  4.  Edited the index.html header to add the following: <script src="/style.js<http://localhost:8383/scripts/style.js>"></script>
  5.  Run the application

The application opens chrome via the connector and at the following URL is my index.html file:
http://localhost:8383/HTML5Application/test/index.html

If I view the source and click on /style.js<http://localhost:8383/scripts/style.js> in <script src="/style.js<http://localhost:8383/scripts/style.js>"></script> the file is not found. But if a change what is in the header to:
<script src="/<http://localhost:8383/scripts/style.js>HTML5Application/<http://localhost:8383/HTML5Application/test/index.html>style.js<http://localhost:8383/scripts/style.js>"></script> and click on /<http://localhost:8383/scripts/style.js>HTML5Application/<http://localhost:8383/HTML5Application/test/index.html>style.js<http://localhost:8383/scripts/style.js> the file is found. The file is also found if I step things back: <script src="../style.js<http://localhost:8383/scripts/style.js>"></script> and click on ../style.js<http://localhost:8383/scripts/style.js>.

I want to configure things so that <script src="/style.js<http://localhost:8383/scripts/style.js>"></script> works. Is there a way to do this?

There is a way to set Web Root in:
project > properties > run

By default this was set to: "/HTML5Application"

I have had no success in changing this or settings in:
project > properties > sources

Many thanks and best wishes,

Andy