This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Restricting Http methods thru tomcat configurations 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 » Products » Tomcat
Bookmark "Restricting Http methods thru tomcat configurations" Watch "Restricting Http methods thru tomcat configurations" New topic
Author

Restricting Http methods thru tomcat configurations

Gibu John
Greenhorn

Joined: Mar 26, 2007
Posts: 2
How will I restrict http methods like delete put etc thru tomcat configuration or thru web.xml . I am not using security roles. authentication is thru database maintained users.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You shouldn't need to.

Writing servlets amounts to white listing the methods you want to support by overriding them. The implementation of HttpServlet in Tomcat returns a 405 response code for any of the service methods that you don't explicitly override.



Most people only override doPost and doGet.
[ March 17, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restricting Http methods thru tomcat configurations
 
Similar Threads
Web Application with JBuilder X and Tomcat
JNDI in Servlets
deploying JSPs under tomcat
debugging applet
jsp:getProperty