i get following error message:
HTTP Status 405 - HTTP method GET is not supported by this URL
type Status report
message HTTP method GET is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
Apache Tomcat/7.0.22
the
servlet code is as follows.
package servlets;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class SearchServlet
*/
public class SearchServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public SearchServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param session
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response, ServletRequest session) throws ServletException, IOException {
// TODO Auto-generated method stub
processRequest(request,response);
}
private void processRequest(HttpServletRequest request,
HttpServletResponse response) {
// TODO Auto-generated method stub
System.out.println("Sairam");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
processRequest(request,response);
}
}
my calling page is following:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Home page</title>
</head>
<body>
<h1><p align="center"><font size="20" color="#ff0000" face="Garamond">SAI OnLine Books and Softwares Store</font></p></h1>
<form action="/OnlineBookStore_proj/Search" method="get">
<p align="right"><input type="submit" value="search">
<input type="text" name="search"></p>
</form>
<img src="web-app/images/books.jpg" align="left" width="150" height="150" >
<img src="web-app/images/softwares.jpg" align="right" width="150" height="150">
<form action="reg_page.html" method="get">
<p align="center"><input type="submit" value="register" ></p>
</form>
<hr width="80%" color="#ff3000" size="3"></hr>
<div>
<!-- displaying text at left and right in the same line -->
<p style="float:left;color:blue"><font size="25">Books</font></p>
<p style="float:right;color:blue"><font size="25">Softwares</font></p>
</div>
</body>
</html>
help me out,
Thank u.