I'm trying to build a new gwt-project (also using maven and spring). My project structure is:
- ... directory
- myapp.admin-webapp
-- src/main/java
--- com.myapp.admin.webapp.client
AdminEntryPoint.java
--- com.myapp.admin.webapp.client.presenter
--- com.myapp.admin.webapp.client.view
-- src/main/recources
--- com.myapp.admin
webapp.gwt.xml
--- spring
myapp.beans.xml
-- src/main/webapp
myapp-admin.html
myapp-admin.css
--- js
--- META-INF
--- resources
--- WEB-INF
applicationContext.xml
web.xml
web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>myapp-admin.html</welcome-file>
</welcome-file-list>
<!-- Add Support for Spring -->
<!-- Default applicationContext location: /WEB-INF/applicationContext.xml -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- exposes the request to the current thread -->
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- UTF-8 filter -->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
webapp.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "gwt-module.dtd">
<module>
<inherits name='com.google.gwt.user.User'/>
<!-- Specify the app entry point class. -->
<entry-point class='myapp.admin.webapp.client.AdminEntryPoint'/>
<source path='myapp.admin.webapp.client'/>
</module>
My simple entry point:
public class AdminEntryPoint implements EntryPoint {
@Override
public void onModuleLoad() {
GWT.log("Hello World!", null);
Label label = new Label("Entry Point!");
label.setStyleName("label");
RootPanel.get().add(label);
}
}
And my basically empty app context:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:annotation-config />
</beans>
When I try to start my application (IDE Eclipse), it seems that there is no problem. I can start my app with the "development mode" and the welcome-page is loaded, but with no entry point.
When I try to debug my application (set my breakpoint to the onLoad-function within the AdminEntryPoint) it never went so far.
So it seems that my application runs perfectly and simply does not know it's entry point, although it's set in webapp.gwt.xml.
Thx for any help :)
Some of the things are missing. Please update or confirm your files as shown below:
webapp.gwt.xml: (add rename-to and change source path)
myapp-admin.html: (conform below line)
Delete all GWT cache files and start a fresh GWT compile before running your application.