【问题标题】:Redirect home page to front controller将主页重定向到前端控制器
【发布时间】:2012-09-13 00:35:13
【问题描述】:

我有一个映射到/Controller 的URL 模式的前端控制器,因此可以在http://localhost:8080/myproject/Controller 上使用。如何配置我的 Web 应用程序,以便 http://localhost:8080/myproject 上的主页自动重定向到它?

【问题讨论】:

    标签: java model-view-controller servlets


    【解决方案1】:

    最简单的方法之一是在web.xml 中将其注册为<welcome-file>

    <welcome-file-list>
        <welcome-file>Controller</welcome-file>
    </welcome-file-list>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-30
      • 2012-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-04
      • 2018-08-16
      相关资源
      最近更新 更多