![](/img/trans.png)
[英]How to set up tomcat context path for web application? .war file name is coming infront of the application name in the url
[英]Is the name of web application always the name of the war?
我正在尝试在Tomcat上安装XWiki。 我检查了web.xml并发现:
<display-name>xwiki</display-name>
<description>XWiki Application</description>
但是localhost:8080/xwiki
返回错误404:
说明所请求的资源(/ xwiki)不可用。
我还发现:
<servlet-mapping>
<servlet-name>XWikiService</servlet-name>
<url-pattern>/XWikiService</url-pattern>
</servlet-mapping>
但是同样的问题:
说明所请求的资源(// XWikiService)不可用。
我的安装有问题吗? 我在catalina.out中没有发现任何错误。 但是当我尝试使用战争名称时:
本地主机:8080 / xwiki-enterprise-web-4.1.2 /
有用!
我应该检查什么?
web.xml
display-name
与用于访问资源的URL对象无关,它只是显示的简短名称或说明,取决于容器使用。 在Tomcat中,它在管理应用程序中使用。
url_pattern
应该引用一个servlet,但是您可能缺少该对象的某些部分。 webapp通常由WAR的名称来引用(取决于容器),因此,如果您的WAR(在其中找到了web.xml
)被命名为xwiki-enterprise-web-4.1.2
,那么您应该尝试:
localhost:8080/xwiki-enterprise-web-4.1.2/XWikiService
来访问servlet,并且 localhost:8080/xwiki-enterprise-web-4.1.2/
加载localhost:8080/xwiki-enterprise-web-4.1.2/
应用程序。 如果后者失败,则您可以尝试使用welcome-file
属性将其默认为加载特定文件。
加载时具体起作用的是什么: localhost:8080/xwiki-enterprise-web-4.1.2/
? 这会加载您的Web应用程序吗? 您是否只想知道servlet的URL? 如果是这样,请尝试以下操作: localhost:8080/xwiki-enterprise-web-4.1.2/XWikiService
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.