Reputation: 16079
How can i redirect users to one of the pages accordingly his domain name?
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>
Thanks!!!
Upvotes: 0
Views: 1687
Reputation: 597076
You can
javax.servlet.Filter
)/
request.getServerName()
and compare with a predefined list of domainsrequest.getRequestDispatcher("/someIndex.jsp").forward()
depending on the domain.However, it looks like a strange use-case, because the user will still be able to access the index files for other domains if he knows them (if they are not hidden in WEB-INF
). But without knowing your requirements I can't suggest a better solution.
Upvotes: 2