The requested resource (/servlet/org.Test.WebForm.Form) is not available
Hello, before I ask for help I thought I should state that I am just starting to teach myself java servlets. Im not new to java, just servlets.
Im trying to create a basic "Please enter your name here" hit submit and be have a new page thats says "Hello name." Im using O'reilly's java servlet programming book and I just can't seem to find what Im doing wrong.
the code for my html page is:
Code:
<html>
<head>
<title>Introductions</title>
</head>
<body>
<FORM ACTION="/servlet/org.Test.WebForm.Form" METHOD="get">
Name: <input type="text" name="name"><br>
<input type="submit" value="submit!">
</FORM>
</body>
</html>
My java code is:
Code:
package org.Test.WebForm;
import java.io.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
public class Form extends HttpServlet
{
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String name = req.getParameter("name");
out.println("<HTML>");
out.println("<HEAD><TITLE>Hello</TITLE></HEAD>");
out.println("<BODY>");
out.println("hello, " + name);
out.println("</BODY></HTML>");
}
public String getServletInfo()
{
return "A servlet that knows the name of the person to whom it's " +
"saying Hello";
}
}
I can get the html page to show but when I hit submit I get an error status saying " The requested resource (/servlet/org.Test.WebForm.Form) is not available" Thanks for the help