I'm using Tomcat 5.5.4. I'm trying to call a servlet that retrieves data from the database. I want to set up a hotlink(hyperlink) on the main web page but can't get it to call the servlet. I've set up the servlet entry in the web.xml file and it works if I open a form with a submit button. I just want a hotlink though to get the data. Does anyone know if this is possible? Thanks
Patrick yes, you can definately call your servlet directly from HTML infact that depends on which Method of the Form you call as there are 2 method types POST / GET.
To call a servlet from an HTML you can put the servlet name in the Form Action and depending on the type of get or put doGet or doPut is called. But yeah name defined in the form action should exist in web.xml
Hi, Thanks to everyone that replied! I have overridden doget with dopost but now that I think about it I don't need to override it for a select from the database. So I will change that and maybe it will work. I don't want to use a form. I want to do a hotlink that calls the servlet directly. I can call the servlet directly if I use a form with a button so I know the web.xml file is set up correctly and the files are in the correct directories. I just can't seem to get it to work calling the servlet without a form. Any example code would be great!