I have 2 questions:
1. Is it necessary to use an XML file to let an HTML file connect to a
servlet? Can't I directly mention the explicit path of the servlet in
the ACTION attribute of the FORM element?
2. I have installed Tomcat on my computer and it's working fine.
I am using an HTML file to access a local servlet via the
following:
<a href="http://localhost:8080
C:/Eclipse/eclipse/projects/project1/servlets1/Servlet1>Link from
here</a>
My servlet is placed in the
c:\eclipse\eclipse\projects\project1\servlets1 folder and the name of
my servlet is: Servlets.class.
However, it's not working when I'm clicking on the hyperlink. What's
the problem?
Paul Hamaker - 22 Mar 2006 11:29 GMT
Your servlet class has to be in a .war file or folder under Tomcat's
webapps.
See
http://javalessons.com/cgi-bin/fun/java-tutorials-main.cgi?ses=ao789&code=sv1&sub=jsp
,source lines 64-88
You may want to read the Form lesson too, where you can see that a
form's action can be a url.
--------------------
Paul Hamaker, SEMM, teaching ICT since 1987
http://javalessons.com