Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] jsp configuration for http method names

FYI,

I updated the JSP configuration page at
http://wiki.eclipse.org/Jetty/Howto/Configure_JSP to include the
"httpMethods" JSPServlet init param.

This is a comma, tab, newline, carriage return or formfeed separated
list of names of http methods to which the JSPServlet should respond.
As the JSPServlet overrides the servlet service() method, it can
service any request, regardless of the http method name. For example,
you can send a request using "FOO" instead of "GET" or "POST" and the
JSPServlet will happily process the request. Of course, this is
subject to the application of any security-constraints you may have in
your annotations, web.xml or web-fragment.xml files.

You can conveniently set this init param for the JSPServlet in the
$JETTY_HOME/etc/webdefault.xml file to restrict the desired set of
http method names. Don't forget to then ensure that this file is
applied to the webapp by calling:

   setDefaultsDescriptor(location-of-the-webdefault.xml-file) on your
WebAppContext

or doing the equivalent in a context xml file:
  <Configure class="org.eclipse.jetty.webapp.WebAppContext"><Set
name="defaultsDescriptor">location-of-the-webdefault.xml-file</Set></Configure>

More instructions are available from the page linked above.

regards,
Jan
-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com – Developer advice, services and support
from the Jetty & CometD experts.


Back to the top