followed this useful blog posting
http://blogs.yellowfish.biz/2010/gwt-development-with-traditional-servlets/
My Test.java file reads as follows
package com.searchsystem.gwt.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.RootPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Test implements EntryPoint {
@SuppressWarnings("unused")
private final GreetingServiceAsync greetingService =
GWT.create(GreetingService.class);
/**
* This is the entry point method.
*/
@Override
public void onModuleLoad() {
RootPanel.get("tabContainer").add(createTabs());
}
private DecoratedTabPanel createTabs() {
DecoratedTabPanel tabPanel = new DecoratedTabPanel();
tabPanel.setStylePrimaryName("tabPanel");
tabPanel.setAnimationEnabled(true);
// Add another tab
Frame bugFrame = new Frame("/bugzilla/");// Apache must be running
for this to be served
bugFrame.setStyleName("frame");
DOM.setElementPropertyInt(bugFrame.getElement(), "frameBorder",
0);// remove frame border
tabPanel.add(bugFrame, "Bugs");
// Return the content
tabPanel.selectTab(0);
tabPanel.ensureDebugId("cwTabPanel");
return tabPanel;
}
}
Web.xml in my war file reads as follows (please note that the order of
the filter, filter-mapping, servlet, servlet-mapping directives is
important):
<?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>/test/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>Test.html</welcome-file>
</welcome-file-list>
</web-app>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment