GWT xml 模式
<servlet-mapping>
<servlet-name>userServlet</servlet-name>
**<url-pattern>/helloservers/userService</url-pattern>**
</servlet-mapping>
有人可以解释一下这个
的用途是什么以及为什么使用它吗?
“com.google.appengine.tools.development.LocalResourceFileServlet doGet 警告:找不到以下文件:/helloservers/userService”
我收到此错误。请解释为什么会出现此错误?可以采取哪些措施来纠正它?
<servlet-mapping>
<servlet-name>userServlet</servlet-name>
**<url-pattern>/helloservers/userService</url-pattern>**
</servlet-mapping>
Can some explain me what is the use of this <url-pattern>
and why it is used?
"com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /helloservers/userService"
Am getting this error. Please explain why is comes? And what can be done to rectify it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的网址由 LocalResourceFileServlet,即。服务器正在尝试在本地文件系统中查找静态文件 - 可能称为“userService”。
我可以想到两个可能的原因:
/helloservers/*
的url-pattern
。这将推翻您引用的 servlet 映射。如果是这种情况,您需要更改其中一个url-pattern
以避免这种歧义。url-pattern
中没有通配符时,GWT 中使用的 servlet 容器可能会自动使用LocalResourceFileServlet
。在这种情况下,将url-pattern
更改为/helloservers/userService/*
并请求 url/helloservers/userService/foo
Your URL is being served by LocalResourceFileServlet, ie. the server is trying to find a static file in your local file system - probably one called "userService".
I can think of two possible reasons for this:
url-pattern
like/helloservers/*
. This would overrule the servlet mapping you've quoted. If that's the case, you need to change one of theurl-pattern
s to avoid this ambiguity.LocalResourceFileServlet
when your servlet'surl-pattern
has no wildcards in it. In that case, change theurl-pattern
to e.g./helloservers/userService/*
and request e.g. the url/helloservers/userService/foo