문제

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's META-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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top