简体   繁体   中英

Open in browser remote html file

I am writing a java client-server application where some clients have the right to put html files to serve as login pages on the server and the server will provide those pages to the rest of the users when they try to log. To this purpose I have added a preview button , that allows the admin set of clients to visualize the page when they upload it or afterwords . The problem I need to figure it out is how to open the browser to preview the file when the resource is not locally (it was uploaded by another admin and therefore it is remote).

Any suggestion and reference will be greatly appreciated !

Depends on the client; my first choice would be to use the Desktop class to make things simple, if you can guarantee Java 6.

If not, the Bare Bones Browser Launch plays some games on JRE < 6.

See this SO post for a bit more info.

If neither of those suits your purposes, you may need to provide some more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM