getClass().getResource(...).openConnection().getURL() returns a URL which is recognized by the browser and can be used to load resources with XHR or <img src='...'>. When no longer needed, convert connection to Closeable and use connection.close().
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 <modelVersion>4.0.0</modelVersion>
4 <groupId>org.apidesign.bck2brwsr</groupId>
5 <artifactId>rt</artifactId>
6 <version>1.0-SNAPSHOT</version>
7 <packaging>pom</packaging>
8 <name>Bck2Brwsr Runtime</name>
10 <groupId>org.apidesign</groupId>
11 <artifactId>bck2brwsr</artifactId>
12 <version>1.0-SNAPSHOT</version>
19 <module>vmtest</module>