File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes url not supported Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "url not supported" Watch "url not supported" New topic
Author

url not supported

thippe swamy
Greenhorn

Joined: Feb 04, 2012
Posts: 10

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.
thippe swamy
Greenhorn

Joined: Feb 04, 2012
Posts: 10

sorry ranchers, if i have troubled any of you. I have hound my mistake.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url not supported
 
Similar Threads
JSP Bean,not able to work my first bean
display the log/output in JSP or HTML page
HTTP Status 405 - HTTP method POST is not supported by this URL.
HTTP method GET is not supported by this URL
exception handling