[英]JSP how to manage welcome-file-list?
如何將用戶重定向到其中一個頁面相應的域名?
web.xml中
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>now_see_this.jsp</welcome-file>
<welcome-file>Another.jsp</welcome-file>
</welcome-file-list>
謝謝!!!
您可以
javax.servlet.Filter
) /
request.getServerName()
並與預定義的域列表進行比較 request.getRequestDispatcher("/someIndex.jsp").forward()
取決於域。 但是,它看起來像一個奇怪的用例,因為如果用戶知道它們(如果它們沒有隱藏在WEB-INF
),用戶仍然可以訪問其他域的索引文件。 但是在不知道您的要求的情況下,我無法提出更好的解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.