题
I got following URL
http://SOMEURL/PREFIX/servlet/test.Home
I thought that PREFIX has something to do with, the <Context path="/PREFIX">
entry. So if i wouldnt set the path it would disappear but it isnt like this. Prefix is still needed.
Because in my html documents i got some Paths to some css Files, which are in the Base Web Content directory under WebContent/css. And with this prefix they arent founy anymore because it tries to find them in /PREFIX/css..
Should i just create a directory similar to the WebContent directory with PREFIX as name?
解决方案
If you want your webapp to be deployed on /PREFIX
then you should:
- Put your
<Context>
element in your webapp'sMETA-INF/context.xml
- Not use the
prefix
attribute in your<Context>
- Name your WAR file PREFIX.war
If you want your webapp to be deployed on /
(that is, with no prefix), then name your WAR file to ROOT.war
(case matters: use capitals for ROOT
).
不隶属于 StackOverflow