how to open HTML page of subdirectory on URL hit
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.
精彩评论