简体   繁体   English

运行我的应用程序时如何默认调用index.jsp

[英]how to call index.jsp as default when Run my application

I have created a web dynamic project and created a folder as view name under the WebContent folder. 我创建了一个Web动态项目,并在WebContent文件夹下创建了一个文件夹作为视图名称。 I kept the index.jsp file inside the view folder. 我将index.jsp文件保留在视图文件夹中。

I want to make it so that when i run my application, it will by default display the index page. 我想要这样做,以便在运行应用程序时默认情况下将显示索引页面。 It is working when keep it inside the webcontent folder but when i put it inside the view folder i am getting an error message (page is not available) 将其保留在webcontent文件夹中时会工作,但是当我将其放入view文件夹中时会收到错误消息(页面不可用)

How can I resolve this problem in eclipse? 如何在Eclipse中解决此问题?

it's all simple , you can configure it in your web.xml file by adding these tags 都很简单,您可以通过添加以下标记在web.xml文件中对其进行配置

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>name you want to see</display-name>
  <welcome-file-list>
    <welcome-file>view/yourFile.jsp</welcome-file>
  </welcome-file-list>
</web-app>

and it will be loaded as the first page while running your application 并且它将在运行您的应用程序时作为首页加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行项目时不会出现对index.jsp的修改 - Modifications in index.jsp doesn't appear when running the project 我无法使用“ localhost:8080 / mywebapp / index.jsp”进行Maven战争 - I can't run Maven war using “localhost:8080/mywebapp/index.jsp” index.jsp文件即使在打开时也会打开 <welcome-file-list> 没有定义 - index.jsp file opens even when the <welcome-file-list> is not defined 如何为REST Web服务发布Javadoc而不是index.jsp页面 - How to publish javadoc instead of index.jsp page for a REST web service 浏览器迫使我下载index.jsp页面,而不是查看它。 我正在使用github页面托管我的项目 - Browser forces me to download my index.jsp page instead of viewing it. I'm using github pages to host my project 如何在 IntelliJ 中配置 TomCat 及其工件以显示与自动生成“index.jsp”不同的 jsp(通过 SpringMVC)? - How do I configure TomCat and its Artifacts in IntelliJ to display a different jsp (through SpringMVC) than the autogen "index.jsp"? 为什么在带有DD的Web项目中找不到index.jsp - Why can not find the index.jsp in the web project with DD 我应该在哪里将index.jsp使用tomcat? - where Should I put index.jsp use tomcat? tomcat无法启动projectname / index.jsp - tomcat can't start projectname/index.jsp 我无法访问 index.jsp 中的嵌套 JavaScript function - I can't access nested JavaScript function in index.jsp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM