Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » I use a RAP application with an embedded server.
I use a RAP application with an embedded server. [message #855776] Wed, 25 April 2012 05:01 Go to next message
Cho HyunJong is currently offline Cho HyunJongFriend
Messages: 103
Registered: July 2009
Location: korea
Senior Member

like this.
wiki.eclipse.org/RAP/FAQ#How_do_I_use_a_RAP_application_with_an_embedded_server

I have a question.
When start the Jetty server, the system browser is opens wish.

Start from the Eclipse IDE as RAP Application.

Help me. thanks.
Re: I use a RAP application with an embedded server. [message #856260 is a reply to message #855776] Wed, 25 April 2012 14:07 Go to previous message
Cho HyunJong is currently offline Cho HyunJongFriend
Messages: 103
Registered: July 2009
Location: korea
Senior Member

Activator...
public void start(...) {
.....
TadpoleOpenBrowser openBrowser = new TadpoleOpenBrowser();

Thread the = new Thread(openBrowser);
the.start();
}

public class TadpoleOpenBrowser implements Runnable {
private static final Logger logger = Logger.getLogger(TadpoleOpenBrowser.class);
public static final String url = "127.0.0.1:10081/db?startup=tadpole";

@Override
public void run() {
String s1 = System.getProperty("os.name").toLowerCase();
Runtime runtime = Runtime.getRuntime();

try {
// 시스템 속도가 느려서 워크벤치가 정상적으로 동작하지 못했을 경우에 대비하여 기다립니다.
try { Thread.sleep(1000); } catch(Exception e) {};

// window
if (s1.indexOf("windows") >= 0) {
runtime.exec(new String[] { "rundll32", "url.dll,FileProtocolHandler", url });

// mac
} else if (s1.indexOf("mac") >= 0) {
Runtime.getRuntime().exec(new String[] { "open", url });

// linux
} else {

// linux
String as[] = { "firefox", "mozilla-firefox", "mozilla", "konqueror", "netscape", "opera" };
boolean isSuccess = false;

int i = 0;
do {

if (i >= as.length)
break;
try {
runtime.exec(new String[] {as[i], url });
isSuccess = true;
break;
} catch (Exception exception) {
i++;
}

} while (true);

if (!isSuccess) logger.info("standlone open url exception ");

}
} catch (Exception e) {
logger.error("standalone start open URL", e);
}
} // end run

} // end class TadpoleOpenBrowser
Previous Topic:help to get all visible rows after tableviewer's viewerfilter changed?
Next Topic:Introduction to 'Tadpole for DB Tools'
Goto Forum:
  


Current Time: Mon Oct 25 14:08:57 GMT 2021

Powered by FUDForum. Page generated in 0.01560 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top