먼저 코드를 제거하십시오. 의 WebContent에서클라우드 파운드리 404하지만 로컬 톰캣은 괜찮습니다.
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Child Tickets</title>
</head>
<body>
<h1>Find all child tickets affected user and their info</h1>
<hr>
<form name="f1" method="GET" action="/FindChildTicket4/FindChildTickets">
<input type="text" name="masterticket">
<button type="submit" value="main" name="btnSubmit">Hello</button>
<br>
<br>
<div id="results">
results html
</div>
</form>
</body>
</html>
web.xml에있는 WebContent에
이index.html을/WEB-INF 자바 자료에
<?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" 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>HelloWorld</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>
</web-app>
HelloAgain.java/SRC/hlo.hello.net
package hlo.hello.net;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class HelloAgain
*/
@WebServlet("/HelloAgain")
public class HelloAgain extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public HelloAgain() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
Eclipse에서 로컬 Apache7 서버에 배포 할 때 html이 실행되고 Hello 버튼을 클릭하면 "Ser ved at :/HelloWorld "를 브라우저에 표시합니다. 나는 우리의 내부 클라우드 파운드리 설치 VIA 이클립스이를 누를 때 나는 안녕하세요 버튼을 클릭하면 는 지금이 얻을
HTTP 상태 404 - /하여 HelloWorld/HelloAgain
유형 상태 보고서
메시지 /하여 HelloWorld/HelloAgain
설명 요청한 리소스를 사용할 수 없습니다. 나는이 사이트를 시도/7.0.62
아파치 톰캣 ... java servlet not found error 404 in eclipse
뿐만 아니라 몇 가지 다른과 권고의 비 클라우드 파운드리 측를 해결 HTTP Status 404 - on Eclipse with Tomcat Java - Servlet 404 error Getting HTTP Status 404 error when trying to run servlet. HTML은 매 시간마다 작동하지만 서블릿을 찾지 않습니다. 또한 배포 된 클라우드 파운드리 서버 파일을 보았고 클래스는 WEB-INF/classes/hlo/hello/net/
매우 낮습니다. 또한 링크 된 사이트의 권장 사항 중 일부는 서버가 종료 될 로컬 apache 배포를 파기했습니다. 클라우드 파운드리를 검색 할 때 좋은 데이터를 찾을 수 없기 때문에 아무나 통찰력을 가지고 있는지 확인하십시오.