This is what I have:
JSP: <form method ="GET" action = "TestResult.do">
<center><input type="submit"></center>
</form>
web-xml: <
servlet>
<servlet-name>
testing</servlet-name>
<servlet-class>testResult.TestResult</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testing</servlet-name>
<url-pattern>/TestResult.do</url-pattern>
</servlet-mapping>
Servlet: package testResult;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TestResult extends HttpServlet{
These work perfectly with JSP in the root directory. The JSP can call servlet with no problem at all. However, If JSP is placed in another directory e.g. root/anotherFolder/file.jsp, then I face the problem of calling my Servlet from the JSP.
Please if you have any answer to this question, please help. I am using
Tomcat as my Container.
Waiting to hear from you.
Thank you.