Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
764 views
in Technique[技术] by (71.8m points)

tomcat - Change root context for a servlet in an IntelliJ IDEA project

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

context


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...