What I had to do was to split the app into "client/server" modules, using the HTTP Filter API as the "server" and the Browser API for the "client". See my sample code at
Index of /src/java/com/jcomeau/blackberry. It's unmaintained and may not compile, but you'll get the idea if you can stomach my coding style. (Warning: it makes some people vomit profusely).