Jetty and GWT (Google Web Toolkit)

As I understand it, GWT uses the built-in Jetty server. Can someone tell me where can I find the Jetty.xml configuration files used by GWT? I have a webapp that uses the use of Jetty ContinuationFilter and ProxyServlet. The application works fine under GWT, but it crashes when launched on a separate Jetty instance outside of GWT. If I can copy the configuration of the GWT Jetty, then I think that everything will be fine with me.

Edit for more information:

My webapp web.xml reads as follows:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <filter> <filter-name>JettyContinuationFilter</filter-name> <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class> </filter> <filter-mapping> <filter-name>JettyContinuationFilter</filter-name> <url-pattern>/bugzilla/*</url-pattern> </filter-mapping> <!-- Servlets --> <servlet> <servlet-name>greetServlet</servlet-name> <servlet-class>com.searchsystem.gwt.server.GreetingServiceImpl</servlet-class> </servlet> <servlet> <servlet-name>jetty-proxy-servlet</servlet-name> <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class> <init-param> <param-name>ProxyTo</param-name> <param-value>http://localhost/</param-value> </init-param> <init-param> <param-name>Prefix</param-name> <param-value>/</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>greetServlet</servlet-name> <url-pattern>/dashboard/greet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>jetty-proxy-servlet</servlet-name> <url-pattern>/bugzilla/*</url-pattern> </servlet-mapping> <!-- Default page to serve --> <welcome-file-list> <welcome-file>Dashboard.html</welcome-file> </welcome-file-list> </web-app> 

and the link to my Bugzilla installation is in this form:

 com.google.gwt.user.client.ui.Frame bugFrame = new Frame("/bugzilla/"); 

Running under Jetty 6.1.26, I get this output:

 Request Attributes Attribute: Value: javax.servlet.forward.request_uri /bugzilla/ org.mortbay.jetty.error_page /jspsnoop/ERROR/404 javax.servlet.forward.servlet_path /bugzilla/ testFilter 1 javax.servlet.error.message NOT_FOUND requestInitialized '' javax.servlet.forward.context_path javax.servlet.error.status_code 404 javax.servlet.error.servlet_name default org.mortbay.jetty.newSessionId 47deq3eo5kblxfrvtc5rljrg javax.servlet.error.request_uri /bugzi 

lla /

+6
jetty gwt
source share
2 answers

no jetty.xml. GWT programmatically installs the server. You can find the settings in

 com.google.gwt.dev.shell.jetty.JettyLauncher 

contained in gwt-dev.jar

+9
source share

See: Serving a GWT Application with Brandon Tilly's Embedded Jet Server (code extraction shown below). It seems he achieved this quite easily, a process that I will confirm tomorrow.

 import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.WebAppContext; public class EmbeddedGwt { public static void main(String[] args) throws Throwable { // Create an embedded Jetty server on port 8080 Server server = new Server(8080); // Create a handler for processing our GWT app WebAppContext handler = new WebAppContext(); handler.setContextPath("/"); handler.setWar("./apps/GwtApplication.war"); // If your app isn't packaged into a WAR, you can do this instead WebAppContext altHandler = new WebAppContext(); altHandler.setResourceBase("./apps/GwtApplication"); altHandler.setDescriptor("./apps/GwtApplication/WEB-INF/web.xml"); altHandler.setContextPath("/"); altHandler.setParentLoaderPriority(true); // Add it to the server server.setHandler(handler); // Other misc. options server.setThreadPool(new QueuedThreadPool(20)); // And start it up server.start(); server.join(); } } 
+2
source share

All Articles