hi
i am calling one servlet form another servlet but this error is coming
HTTP Status 405 - HTTP method GET is not supported by this URL
could anybody plz help where is the problem as i m new to this technology and eager to learn…
my code is
FromServlet.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FromServlet extends HttpServlet {
public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher RD = getServletContext().getRequestDispatcher("/ToServlet?param=method1");
RD.forward(request, response);
}
}
I]ToServlet.java[/I]
import java.io.;
import javax.servlet.;
import javax.servlet.http.*;
public class ToServlet extends HttpServlet {
public void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException {
String param;
param = request.getParameter(“param”);
if (param.compareTo(“method1”)==0) {
try {
method1();
} catch (Exception ex) {}
}
}
public void method1() {
//Do something
}
}