Re: httprequest can't find servlet
gert wrote:
I am trying to do a httprequest to a servlet but i always get 404 from
the server ?
url = POST http://localhost:8001/appointment.do
Did you deploy the servlet to a web container, such as Tomcat?
Is the web server running on localhost, and listening to port 8001?
What do you see if you just browse http://localhost:8001/?
Navigating right directly to a ".do" URL is a bit rare; usually that is done
under the hood by Struts for you.
If you are using Struts, why are you putting HTML in a .java servlet instead
of a JSP?
Where is the application context in your URL? "appointment.do" is not the
name of your application, which name is absent from the URL you posted. What
happens if you open your browser to the raw application (which I'll call "foo"
for pedagogical purposes): http://localhost:8001/foo/ ?
If that works OK, and you've set up your app's deployment descriptor
correctly, then try http://localhost:8001/foo/appointment.do.
I'd try this without Struts first, though, and just mount the servlet
someplace reasonable, like http://localhost:8001/foo/appointment for example.
Struts is just a complication you don't need until you learn how to deploy a
servlet.
--
Lew