日期:2014-05-18  浏览次数:20825 次

急~~帮忙~~在Tomcat下怎样设置根据IP的不同,使其访问的页面也不同
假如是内部人员只能访问
http://192.168.3.23/oa,
http://192.168.3.24/ofr,
http://192.168.3.25/of
而外部人员只能访问
http://202.136.56.28/oa,
http://202.136.56.29/ofr,
http://202.136.56.38/of

------解决方案--------------------
做一个redirect?
------解决方案--------------------
使用Filter进行控制
------解决方案--------------------
用request里的getURL能得到用户输入的完整网址,再判断一下就行了。
------解决方案--------------------
将Tomcat中ROOT文件下的index.jsp删除,
重建index.jsp
<%
if (request.getRequestURL().indexOf( "192.168 ") == -1) {
response.sendRedirect( "http://202.136.56.28/oa, ");//外部
}else{
response.sendRedirect( "http://192.168.3.23/oa "); 内部
}
%
好象不能同时设置许多页面
------解决方案--------------------
假如是内部人员只能访问
http://192.168.3.23/oa,
http://192.168.3.24/ofr,
http://192.168.3.25/of
而外部人员只能访问
http://202.136.56.28/oa,
http://202.136.56.29/ofr,
http://202.136.56.38/of

如果是使用linux作服务器,可以用tcpwrapper+xinetd,开两个tomcat~~