Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Limit max content size for post.

Which version of Jetty? (be specific!)

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Thu, Nov 14, 2013 at 12:21 PM, Rajasekar Elango <relango@xxxxxxxxxxxxxx> wrote:

We would like to limit max size of json data can be posted using REST api. Based on this documentation
I have set value of attribute "org.eclipse.jetty.server.Request.maxFormContentSize" to 2 (picked very small value for testing)  for jetty Server class using spring configuration.

Here is the code of spring configuration:

<bean id="jettyServer" class="org.eclipse.jetty.server.Server"

<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="jettyServer"/>
        <property name="targetMethod">
        <property name="arguments">

Before starting the server, I also verified that attribute "org.eclipse.jetty.server.Request.maxFormContentSize" has the value "2" on jettyServer instance.

However, I can successfully post json data to REST api over 2 bytes and not getting any errors. 
Am I missing anything? What is right way to limit content size that jetty can accept and verify if it works?


jetty-users mailing list

Back to the top