GWT xml 模式

发布于 2025-01-02 15:38:10 字数 441 浏览 2 评论 0原文

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

·深蓝 2025-01-09 15:38:10

您的网址由 LocalResourceFileServlet,即。服务器正在尝试在本地文件系统中查找静态文件 - 可能称为“userService”。

我可以想到两个可能的原因:

  • 您的 web.xml 中有另一个 servlet,它具有类似于 /helloservers/*url-pattern 。这将推翻您引用的 servlet 映射。如果是这种情况,您需要更改其中一个 url-pattern 以避免这种歧义。
  • 当您的 servlet 的 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:

  • There's another servlet in your web.xml that has a url-pattern like /helloservers/*. This would overrule the servlet mapping you've quoted. If that's the case, you need to change one of the url-patterns to avoid this ambiguity.
  • The servlet container used in GWT may automatically use LocalResourceFileServlet when your servlet's url-pattern has no wildcards in it. In that case, change the url-pattern to e.g. /helloservers/userService/* and request e.g. the url /helloservers/userService/foo
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文