[英]GWT Maven Application Entry Point not loaded
I'm trying to build a new gwt-project (also using maven and spring). 我正在尝试建立一个新的gwt项目(也使用maven和spring)。 My project structure is: 我的项目结构是:
-
... directory -
...目录
web.xml file: web.xml文件:
<?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: 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. 当我尝试启动应用程序(IDE Eclipse)时,似乎没有问题。 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. 当我尝试调试应用程序(将断点设置为AdminEntryPoint中的onLoad-function)时,它从未走过。
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. 因此,尽管它是在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) webapp.gwt.xml :(添加重命名至并更改源路径)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "gwt-module.dtd">
<module rename-to='myapp'>
<inherits name='com.google.gwt.user.User'/>
<!-- Specify the app entry point class. -->
<entry-point class='myapp.admin.webapp.client.AdminEntryPoint'/>
<source path='client'/>
</module>
myapp-admin.html: (conform below line) myapp-admin.html :(符合以下行)
<script type="text/javascript" src="myapp/myapp.nocache.js"></script>
Delete all GWT cache files and start a fresh GWT compile before running your application. 在运行应用程序之前,请删除所有GWT缓存文件并开始新的GWT编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.