【发布时间】:2015-02-21 17:08:11
【问题描述】:
我有
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>DBTest</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Test</servlet-name>
<servlet-class>com.package1.Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
</web-app>
servlet Test.java 在
src/com.package1/Test.java
还有
WebContent/Login.jsp有
<form method="POST" action="../Test">
</form>
当我在 web.xml 中添加 servlet 映射并在服务器上运行时,它无法连接到 localhost。
【问题讨论】:
-
服务器是否抛出任何错误?
-
将属性 'source' 设置为 'org.eclipse.jst.jee.server:Project1' 没有找到匹配的属性。
-
我很确定这只是一个警告。
-
您的服务器没有提出这些更改,或者您的表单提交不起作用?