Change root context for a servlet in an IntelliJ I

2019-01-26 11:55发布

I have created two servlets that run when I use their url-pattern that is defined in my web.xml file.

For example, to run the first one I type the following in my browser:

http://localhost:8080/XmlServletPath

I want to find a way to run these servlets from a different root context, for example:

http://localhost:8080/SimpleServletProject/XmlServletPath

When I try the above URL now I am getting the following error:

HTTP Status 404 - /SimpleServletProject/XmlServletPath

type Status report
message /SimpleServletProject/XmlServletPath
description The requested resource is not available.

PS: I am using Tomcat 7.0.35.

1条回答
家丑人穷心不美
2楼-- · 2019-01-26 12:22

Application context can be specified in the Deployment tab of the Tomcat Run/Debug configuration:

context

查看更多
登录 后发表回答