gpt4 book ai didi

java - 无法在tomcat服务器上的eclipse上运行Web项目

转载 作者:行者123 更新时间:2023-11-29 03:56:41 24 4
gpt4 key购买 nike

<分区>

我在 WebContent/WEB-INF/Form.html 位置制作了一个带有 form.html 的小型 Web 应用程序

在我名为“ApplicaitonOne”的项目的src文件夹下有servletOne.java Servlet.javaIcecream.java

Form.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p><kbd>SELECT VALUE</kbd></p>
<p>
<label>
<input type="radio" name="RadioGroup1" value="Vanilla" id="RadioGroup1_0" />
Vanilla</label>
<br />
<label>
<input type="radio" name="RadioGroup1" value="Chocolate" id="RadioGroup1_1" />
CHocholate</label>
<br />
<label>
<input type="radio" name="RadioGroup1" value="Strawberry" id="RadioGroup1_2" />
Strawberry</label>
<br />
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" />
<br />
</p>
</form>
<p>&nbsp;</p>
</body>
</html>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ApplicationOne</display-name>
<welcome-file-list>

<welcome-file>Form.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>ServletOne</servlet-name>
<servlet-class>com.example.ServletOne</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ServletOne</servlet-name>
<url-pattern>/Welcome</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>
15
</session-timeout>
</session-config>

<context-param>
<param-name>flavour</param-name>
<param-value>Choclate</param-value>
</context-param>

<listener>
<listener-class>
com.example.ServletInt
</listener-class>
</listener>

</web-app>

将项目作为服务器运行时,我得到:

address in address bar: http://localhost:8080/ApplicationOne/
HTTP Status 404 - /ApplicationOne/
type Status report
message /ApplicationOne/
description The requested resource (/ApplicationOne/) is not available.
Apache Tomcat/5.5.31

form.html 作为服务器运行时,我得到:

address in address bar: http://localhost:8080/ApplicationOne/WEB-INF/Form.html
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
Apache Tomcat/5.5.31

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com