youngjiandong
25 Nov 2009, 12:40 AM
I use directjngine1.1,when i start jetty web app in context '/',
private static void startJettyServer() {
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8090);
server.setConnectors(new Connector[]{connector});
WebAppContext appContext = new WebAppContext();
appContext.setServer(server);
appContext.setContextPath("/");
appContext.setWar("WebContent/");
server.addHandler(appContext);
try {
server.start();
while (System.in.available() == 0) {
Thread.sleep(5000);
}
server.stop();
server.join();
} catch (Exception e) {
System.exit(100);
}
}
access url:http://localhost:8090/extjs/examples/direct/direct.jsp,show
Successful call to TestAction.doEcho with response:
nullCall to TestAction.multiply failed with message:
Unable to connect to the server.
when i change to appContext.setContextPath("/s"),and access url http://localhost:8090/s/extjs/examples/direct/direct.jsp,it ok.
private static void startJettyServer() {
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8090);
server.setConnectors(new Connector[]{connector});
WebAppContext appContext = new WebAppContext();
appContext.setServer(server);
appContext.setContextPath("/");
appContext.setWar("WebContent/");
server.addHandler(appContext);
try {
server.start();
while (System.in.available() == 0) {
Thread.sleep(5000);
}
server.stop();
server.join();
} catch (Exception e) {
System.exit(100);
}
}
access url:http://localhost:8090/extjs/examples/direct/direct.jsp,show
Successful call to TestAction.doEcho with response:
nullCall to TestAction.multiply failed with message:
Unable to connect to the server.
when i change to appContext.setContextPath("/s"),and access url http://localhost:8090/s/extjs/examples/direct/direct.jsp,it ok.