开发者

how to open HTML page of subdirectory on URL hit

开发者 https://www.devze.com 2023-04-13 07:18 出处:网络
i have a question: I have a scenario that when user opens http://MY开发者_JAVA百科WEBSITE.com/abc/ , the user is directed to xyz.html page which is in abc subdirectory. I am using Java for web develo

i have a question:

I have a scenario that when user opens http://MY开发者_JAVA百科WEBSITE.com/abc/ , the user is directed to xyz.html page which is in abc subdirectory. I am using Java for web development. How can I do this in web.xml?

P.S. URL is http://MYWEBSITE.com/abc/ not http://MYWEBSITE.com/abc


you can use the welcome-file attribute in the web.xml

example:

<welcome-file>xyz.html</welcome-file>

This would get tomcat to look for a page matching the name (if found) and load it.

0

精彩评论

暂无评论...
验证码 换一张
取 消