简体   繁体   English

如何使用上下文路径访问Tomcat中的应用程序

[英]How to access application in Tomcat with Context path

I have a web application which is developed with J2EE, GWT and hosting on Tomcat(version-7.0).我有一个使用 J2EE、GWT 开发并托管在 Tomcat(7.0 版)上的 Web 应用程序。 I have webapp called "Courses" which is plcaed in tomcat/webapps folder.我有一个名为“课程”的 web 应用程序,它位于 tomcat/webapps 文件夹中。 I am accessing my "courses" application by using the following Url: http://localhost:8085/Courses .我正在使用以下 URL 访问我的“课程”应用程序: http://localhost:8085/Courses In my courses application i have so many slices like "physics", "maths" etc.I need to access "physics" Now i want to access my application by entering the Url:在我的课程应用程序中,我有很多切片,如“物理”、“数学”等。我需要访问“物理”现在我想通过输入 URL 来访问我的应用程序:

http://localhost:8085/Courses/physics http://localhost:8085/Courses/physics

How can I run my courses application by entering the above URL.如何通过输入上述 URL 运行我的课程应用程序。

In GWT you should use GWT's history mechanism for this.在 GWT 中,您应该为此使用 GWT 的历史记录机制。

The URL you wish http://localhost:8085/Courses/physics isn't really possible using GWT (or you must create multiple modules but that seems a big overkill for your situation).你想要的 URL http://localhost:8085/Courses/physics使用 GWT 是不可能的(或者你必须创建多个模块,但这对于你的情况来说似乎是一个很大的矫枉过正)。

But you could have an url like : http://localhost:8085/Courses#physics但是你可以有一个像这样的网址: http://localhost:8085/Courses#physics

Check : http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html检查: http : //www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM