Spring MVC 3 映射
这看似简单,但尚未找到解决方案。 如何映射到我的应用程序 www.mysite.com.br/MyController 而不是 www.mysite.com.br/servlet-name/MyController。
谢谢
This may seem simple, but not yet found a solution.
How to map to my applications www.mysite.com.br/MyController instead of www.mysite.com.br/servlet-name/MyController.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
鉴于您使用的是 Tomcat,您可能需要将上下文根设置为服务器的默认根。
如果您的应用程序是在 server.xml 中配置的,那么这意味着您将
上的 path 属性设置为空字符串,即“ ”。请参阅 http://tomcat.apache.org/tomcat-6.0-doc/ config/context.html
如果您在 IDE 中运行 Tomcat,还有其他方法可以设置路径属性,例如直接从 Eclipse。在 Eclipse 中,您可以在服务器窗口的“模块”选项卡中设置路径属性。
Given that you're using Tomcat, you probably need to set your context root to be the default for your server.
If your application is configured in server.xml then this means you set the path attribute on
<Context>
to an empty string, ie "".See http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
There are other ways of setting the path attribute if you're running Tomcat in an IDE, for example directly from Eclipse. In Eclipse you set the path attribute in the Modules tab on the server window.