First lets get the code out of the way.
index.html in WebContent
<!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 in WebContent/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 in Java Resources/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);
}
}
when I deploy this in Eclipse to the local Apache7 server the html fires off and when I click the Hello button I get back the "Served at: /HelloWorld" in the browser. Now when I push this to our internal Cloud Foundry setup VIA Eclipse I get this when I click on the Hello button
HTTP Status 404 - /HelloWorld/HelloAgain
type Status report
message /HelloWorld/HelloAgain
description The requested resource is not available.
Apache Tomcat/7.0.62
I have tried these sites... HTTP Status 404 - on Eclipse with Tomcat Java - Servlet 404 error Getting HTTP Status 404 error when trying to run servlet java servlet not found error 404 in eclipse
as well as a few others and non of the recommendations fixes the cloud foundry side. The HTML will work every singe time but it never finds the servlet. I also have looked at the cloud foundry server files I deployed and the class is there under WEB-INF/classes/hlo/hello/net/
Very odd. Also some of the recommendations in the linked sites broke the local apache deployemtn to where the server would shutdown. Just seeing if anyone has any insight since I cannot find any good data when searching for cloud foundry 404.