Server-Side Development Section Index | Page 185
How do I support both GET and POST protocol from the same Servlet?
The easy way is, just support POST, then have your doGet method
call your doPost method:
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{...more
Why doesn't my servlet work inside a tag?
If you use your servlet inside an SSI, you must use
res.getOutputStream() and not
res.getWriter(). Check the server error logs for more
details.
more
Is it the "servlets" directory or the "servlet" directory?
For Java Web Server:
on the file system, it's "servlets"
c:JavaWebServer1.1servletsDateServlet.class
in a URL path, it's "servlet"
http://www.stinky.com/servlet/DateServlet
...more
How do I set my CLASSPATH for servlets?
That depends.
For developing servlets, just make sure that the JAR file containing javax.servlet.* is in your CLASSPATH, and use your normal development tools (javac and so forth).
For JSDK: J...more