I know it has something to do with WEB-INF\classes
. But here is the code I compiled after putting the appropriate .jar
files in my class path.
import java.io.* ;
import javax.servlet.http.* ;
public class BeeServlet extends HttpServlet
{
public void doGet( HttpServletRequest request , HttpServletResponse response )
{
response.setContentType("text/html");
try
{
PrintWriter out = response.getWriter();
out.println( "a-buzz-buzz ..." );
out.close();
}
catch( Exception e )
{
System.out.println( "cannot get writer: " + e );
}
}
}
It compiles fine, but I have not found any type of like example as in where to put it and how to call it with the localhost:8080
URL. I'm doing this without an IDE to try to learn as best I can but this point is simply confusing to me...
EDIT- I had compiled this code. I put it into the tomcat 7.0/webapps/BeeServlet/WEB-INF/classes directory like all the tutorials say to do. I type in localhost:8080/BeeServlet, and nothing happens. This just doesn't make sense.