I'm using jsp:include -directive to include .html files as layout elements can change often. But when a form (using POST) goes to that JSP page I get error "Included servlet error: 405: HTTP method POST is not supported by this URL". That means that the included .html file does not support POST methods. When I change the form method to GET no errors are given and the file is included fine. Any ideas how I can support POST method forms too using this approach?
Created May 4, 2012
Serge Knystautas
I'm not sure why your servlet engine is doing this... this is perfectly valid usage. Either file a bug report with your servlet engine vendor or switch engines.
As a work around, you should be able to rename your .html to .jsp. This will compile your HTML to a JSP (obviously), but a JSP always uses the service() method and this should avoid the bug in your servlet engine. Not ideal, but that should work.