java spring-mvc 应用程序的默认页面是什么

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5132365/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 09:36:52  来源:igfitidea点击:

what is the default page for spring-mvc application

javaspring-mvc

提问by

IF i have this line in web.xml then i know which is landing page

如果我在 web.xml 中有这一行,那么我就知道哪个是登陆页面

<welcome-file-list>
  <welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>

Now i want to know that if i don't use that then which is the landing page

现在我想知道,如果我不使用它,那么哪个是登陆页面

回答by Ramkailash

I am using Spring STS IDE for developing spring mvc application. It's provide home.jsp page which is the default page in spring mvc and you can change easily inside web.xml file of the Spring MVC project Another option you can put your index.jsp page inside webapp folder it's bydefault run first.

我正在使用 Spring STS IDE 来开发 spring mvc 应用程序。它提供了 home.jsp 页面,它是 spring mvc 中的默认页面,您可以在 Spring MVC 项目的 web.xml 文件中轻松更改另一个选项,您可以将 index.jsp 页面放在 webapp 文件夹中,它默认首先运行。

回答by Kaustubh Kallianpur

You have the whole documentation here!!!

你在这里有完整的文档!!!

It has got all the answers you may need in your future too.

它也提供了您未来可能需要的所有答案。

Usually in an MVC Application, The '/' or 'homepage' is usually not directly called. All requests in an MVC Application should be sent to a dispatcher - servlet who handles all incoming Front End requests and forwards them to respective controllers. You can find a basic Spring MVC Code to create an app Here.. MVC Model

通常在 MVC 应用程序中,通常不会直接调用“/”或“主页”。MVC 应用程序中的所有请求都应发送到调度程序 - servlet,后者处理所有传入的前端请求并将它们转发到相应的控制器。您可以在此处找到基本的 Spring MVC 代码来创建应用程序。 MVC模型