이전 게시물 here에 이어 모든 소스 파일을 model
패키지로 제거 했으므로 http://localhost:8080/MyFirstServlet
을 실행하는 동안 프로젝트로드가 거부됩니다.간단한 JSP 파일을 열려고하면 HTTP 상태 500이 생성됩니다.
의 web.xml :
<?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_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>MyFirstServlet</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>
<description></description>
<display-name>LoginServlet</display-name>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>model.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/model/LoginServlet</url-pattern>
</servlet-mapping>
</web-app>
[1]: https://stackoverflow.com/questions/11282231/jsp-page-wont-move-the-another-page-after-user-enters-the-input/11283006#11283006
이 index.jsp가가가 :
<%@ page language="java" contentType="text/html; charset=windows-1255"
pageEncoding="windows-1255"%>
<!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=windows-1255">
<title>Insert title here</title>
</head>
<body>
<form action="model/LoginServlet" method="POST">
First Name: <input type="text" name="firstName" size="20"><br>
Last Name: <input type="text" name="lastName" size="20">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
이것은이다
여기 파일입니다, 범인 web.xml
의심 프로젝트 계층 구조 :
나는 http://localhost:8080/MyFirstServlet
를 실행하고 여기에 도달하면 : 텍스트 필드에
first
입력
및 second
을 다음이 얻을 : 나는했습니다
을 그것을 고치려고했지만 아무 것도하지 않았다. 그래서 어떤 충고도 고맙게 생각한다. :)
여전히 작동하지 않습니다. 다른 아이디어가 있습니까? thanks – ron
그래도 작동하지 않는다면 새로운 스택 추적이 있어야합니다. 그렇지 않으면 새 web.xml이 제대로 배포되지 않고 여전히 이전 web.xml이 참조됩니다. –