我这有个内部后台发布网站系统,它一使用时就是先要内部管理员登陆,即浏览器访问www.xxxx.com时会进www.xxxx.com/login.jsp,用完后生成的网页放在了根目录下的site目录下,而现在我想要当外部用户访问访问www.xxxx.com时会显示site目录中的index.html,而当内部用户访问www.xxxx.com时会显示这个login.jsp,不知各位有什么解决方案?

解决方案 »

  1.   

    用request.getRemoteAddr()判断下,如果是内网的IP,就转login.jsp,否则就index.html
      

  2.   

    哈,又是你啊,怎么转?<from>/index.html </from> <to type="redirect">/site/bjthinking/index.html </to>
    我试了,但没反应,好像首页就写死在login.jsp了一样,web.xml中是这么配置的: 
    <welcome-file-list>
      <welcome-file>index.shtml</welcome-file> 
      <welcome-file>index.html</welcome-file> 
      <welcome-file>index.htm</welcome-file> 
      <welcome-file>index.jsp</welcome-file> 
      <welcome-file>default.html</welcome-file> 
      <welcome-file>default.htm</welcome-file> 
      <welcome-file>default.jsp</welcome-file> 
      </welcome-file-list>
      

  3.   

    urlrewrite-2.6.0.jar还有加一些<filter>、<filter-mapping> 什么的都搞了,自己做个小页面跳转能转
      

  4.   

    struts2.x登录页面的跳转可以将根据配置文件来跳转
      

  5.   

    哦,是<from>/login.jsp</from> <to type="redirect">/site/bjthinking/index.html </to>
    urlrewrite-2.6.0.jar还有加一些 <filter>、 <filter-mapping> 什么的都搞了,自己做个小页面跳转能转,但这个没转成
      

  6.   

    whereusejava~~!怎么配?在哪配??
      

  7.   

    好像首页就写死在login.jsp了一样//这里是在Struts配置的跳转吧?你就在这个ACTION里得到request,getRemoteAddr()取得客户端IP..用urlrewrite怎么实现内网和外网的区分就不清楚了
      

  8.   

    我试了才发现这个用IP判断的方案不行,因为这个B/S系统不论是管理员还是普通用户访问都是远程访问,不存在所谓内网外网之分,各位还有别的方案吗?
      

  9.   

    默认的首页都设置为index.jsp,在index.jsp写段
    判断ip,如果是内网的ip就跳转到login.jsp页面的jsp代码,
      

  10.   

    那就根据用户权限类型判断,有管理权限的redirect到A,没有的redireact到B
      

  11.   

    晕,都是远程,除非你管理员登陆的IP是固定的
    如果是动态IP......
      

  12.   

    额 过滤器应该可以实现吧 ···filter···  
      

  13.   

    我觉得用过滤器可以实现,在过滤器中使用getRemoteAddr()方法