hello all, i am using apache tomcat 5.5.11 and i need some assistance regarding this topic.
i have a class which needs to be called from a html(i.e, in the action i need to pass a link which will call up the servlet) if it was in the case of j2ee server, i can call the servlet with an alias, but i dont know how to do it with tomcat.
moreover, where shoud be the class file stored, because, in the earlier versions, the class file used to be stored in the classes directory found under webapps directory.
i am in need of this and would be thankful if any one could revert back with the steps in which i can accomplish my requirement.
got it guys, You need to put the .class file in the classes folder within WEB-INF(if the folder does not exist,as it will not, you need to make it) and the respective jsp or html in the root directory. then you need to map the servlet in the web.xml which is available in the ROOT directory and would appear like this:-
when you are calling the servlet, in the form you need to specify like this as given below:
where myservlet is referring to the url-pattern in the web.xml file.