How gwt compiler finds gwt_servlets into gwtModule?
gwt编译器如何将gwt_servlets发现到gwtModule中?
Right now I am getting exception "The requested resource (/finalWar/GWTAPPS/gwtmainmodule/GWTServlet) is not available."
现在我得到例外“请求的资源(/ finalWar / GWTAPPS / gwtmainmodule / GWTServlet)不可用。”
/finalWar/GWTAPPS/gwtmainmodule/GWTServlet = /warFileName/GWTAPPS/myGwtModuleName/GWTServletName
/ finalWar / GWTAPPS / gwtmainmodule / GWTServlet = / warFileName / GWTAPPS / myGwtModuleName / GWTServletName
<servlet>
<servlet-name>GWTServlet</servlet-name>
<servlet-class>.ui.gwtmainmodule.server.GWTServletImpl</servlet-class>
</servlet>
<servlet-mapping >
<servlet-name>GWTServlet</servlet-name>
<url-pattern>/GWTServlet</url-pattern>
</servlet-mapping>
I manually added compiled gwt_servlet class in gwt module still same issue. :-|
我在gwt模块中手动添加编译的gwt_servlet类仍然是同样的问题。 : - |
I want to know How GWT Compiler finds gwtServlets (RemoteServiceServlet) ?
我想知道GWT Compiler如何找到gwtServlets(RemoteServiceServlet)?
Any help or guidance in this matter would be appreciated
任何有关此事的帮助或指导将不胜感激
1 个解决方案
#1
0
Paths in a web.xml are relative to the webapp's root (the folder where you have a WEB-INF subfolder containing your web.xml).
web.xml中的路径是相对于webapp的根目录(您拥有包含web.xml的WEB-INF子文件夹的文件夹)。
So, you have to either adjust the path in the web.xml to the one your client calls (GWTAPPS/gwtmainmodule/GWTServlet
, or gwtmainmodule/GWTServlet
, it's hard to tell from your description), or adjust the path your client-side code uses (either using the @RemoteServiceRelativePath
–note that this path is relative to your module, so probably gwtmainmodule
in your case, not the HTML page that loads the nocache.js
, also known as the host page; note that you can use ../
to walk up the folder hierarchy– or cast your RPC service to ServiceDefTarget
and call setServiceEntryPoint
). All of this is at runtime, and is about URLs, not files (and keep in mind you have client and server sides which talk in HTTP through the network)
因此,您必须将web.xml中的路径调整为客户端调用的路径(GWTAPPS / gwtmainmodule / GWTServlet,或gwtmainmodule / GWTServlet,很难从您的描述中得知),或者调整客户端代码的路径使用(使用@RemoteServiceRelativePath -note,这个路径相对于你的模块,所以在你的情况下可能是gwtmainmodule,而不是加载nocache.js的HTML页面,也称为主页;请注意你可以使用.. /走向文件夹层次结构 - 或将RPC服务转换为ServiceDefTarget并调用setServiceEntryPoint)。所有这些都是在运行时,并且是关于URL,而不是文件(并记住你有客户端和服务器端通过网络通过HTTP进行通信)
That has strictly nothing to do with the GWT compiler though, or even dev mode.
这与GWT编译器严格无关,甚至与开发模式无关。
#1
0
Paths in a web.xml are relative to the webapp's root (the folder where you have a WEB-INF subfolder containing your web.xml).
web.xml中的路径是相对于webapp的根目录(您拥有包含web.xml的WEB-INF子文件夹的文件夹)。
So, you have to either adjust the path in the web.xml to the one your client calls (GWTAPPS/gwtmainmodule/GWTServlet
, or gwtmainmodule/GWTServlet
, it's hard to tell from your description), or adjust the path your client-side code uses (either using the @RemoteServiceRelativePath
–note that this path is relative to your module, so probably gwtmainmodule
in your case, not the HTML page that loads the nocache.js
, also known as the host page; note that you can use ../
to walk up the folder hierarchy– or cast your RPC service to ServiceDefTarget
and call setServiceEntryPoint
). All of this is at runtime, and is about URLs, not files (and keep in mind you have client and server sides which talk in HTTP through the network)
因此,您必须将web.xml中的路径调整为客户端调用的路径(GWTAPPS / gwtmainmodule / GWTServlet,或gwtmainmodule / GWTServlet,很难从您的描述中得知),或者调整客户端代码的路径使用(使用@RemoteServiceRelativePath -note,这个路径相对于你的模块,所以在你的情况下可能是gwtmainmodule,而不是加载nocache.js的HTML页面,也称为主页;请注意你可以使用.. /走向文件夹层次结构 - 或将RPC服务转换为ServiceDefTarget并调用setServiceEntryPoint)。所有这些都是在运行时,并且是关于URL,而不是文件(并记住你有客户端和服务器端通过网络通过HTTP进行通信)
That has strictly nothing to do with the GWT compiler though, or even dev mode.
这与GWT编译器严格无关,甚至与开发模式无关。