Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Accessing servlet from html page

Thread view: 
cat_dog_a.s - 22 Mar 2006 09:22 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.