[英]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.