Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9090675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:25:45+00:00 2026-06-16T22:25:45+00:00

Following up on this GWT-RPC question (and answer #1) re. field size checking ,

  • 0

Following up on this GWT-RPC question (and answer #1) re. field size checking, I would like to know the right way to check pre-deserialization for max data size sent to server, something like if request data size > X then abort the request. Valuing simplicity and based on answer on aforementioned question/answer, I am inclined to believe checking for max overall request size would suffice, finer grained checks (i.e., field level checks) could be deferred to post-deserialization, but I am open to any best-practice suggestion.

Tech stack of interest: GWT-RPC client-server communication with Apache-Tomcat front-end web-server.

I suppose a first step would be to globally limit the size of any request (LimitRequestBody in httpd.conf or/and others?).
Are there finer-grained checks like something that can be set per RPC request? If so where, how? How much security value do finer grain checks bring over one global setting?

To frame the question more specifically with an example, let’s suppose we have the two following RPC request signatures on the same servlet:

public void rpc1(A a, B b) throws MyException;
public void rpc2(C c, D d) throws MyException;

Suppose I approximately know the following max sizes:

  • a: 10 kB
  • b: 40 kB
  • c: 1 M B
  • d: 1 kB

Then I expect the following max sizes:

  • rpc1: 50 kB
  • rpc2: 1 MB

In the context of this example, my questions are:

  1. Where/how to configure the max size of any request — i.e., 1 MB in my above example? I believe it is LimitRequestBody in httpd.conf but not 100% sure whether it is the only parameter for this purpose.
  2. If possible, where/how to configure max size per servlet — i.e., max size of any rpc in my servlet is 1 MB?
  3. If possible, where/how to configure/check max size per rpc request — i.e., max rpc1 size is 50 kB and max rpc2 size is 1 MB?
  4. If possible, where/how to configure/check max size per rpc request argument — i.e., a is 10 kB, b is 40 kB, c is 1 MB, and d is 1 kB. I suspect it makes practical sense to do post-deserialization, doesn’t it?
  5. For practical purposes based of cost/benefit, what level of pre-deserialization checking is generally recommended — 1. global, 2. servlet, 3. rpc, 4. object-argument? Stated differently, what is roughly the cost-complexity on one hand and the added value on the other hand of each of the above pre-deserialization level checks?

Thanks much in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:25:46+00:00Added an answer on June 16, 2026 at 10:25 pm

    Based on what I have learned since I asked the question, my own answer and strategy until someone can show me better is:

    1. First line of defense and check is Apache’s LimitRequestBody set in httpd.conf. It is the overall max for all rpc calls across all servlets.
    2. Second line of defense is servlet pre-deserialization by overriding GWT AbstractRemoteServiceServlet.readContent. For instance, one could do it as shown further below I suppose. This was the heart of what I was fishing for in this question.
    3. Then one can further check each rpc call argument post-deserialization. One could conveniently use the JSR 303 validation both on the server and client side — see references StackOverflow and gwt r.e. client side.

    Example on how to override AbstractRemoteServiceServlet.readContent:

    @Override 
    protected String readContent(HttpServletRequest request) throws ServletException, IOException
    {
      final int contentLength = request.getContentLength();
      // _maxRequestSize should be large enough to be applicable to all rpc calls within this servlet.
      if (contentLength > _maxRequestSize)
        throw new IOException("Request too large");
      final String requestPayload = super.readContent(request);
      return requestPayload;
    }
    

    See this question in case the max request size if > 2GB.

    From a security perspective, this strategy seems quite reasonable to me to control the size of data users send to server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following this question and answer , I still have a bit trouble in the
I am trying to put together a GWT webapp following this GWT MVP tutorial
I am learning GWT, so I am following this tutorial from Google GWT https://developers.google.com/web-toolkit/tools/gwtdesigner/tutorials/stockwatcher
Following this question, it seems that it is possible to open a file from
I'm using the following code in gwt: <g:DockLayoutPanel unit='EM'> <g:north size='5'> <g:Label>www.wing-project.org</g:Label> </g:north> <g:west
Following this tutorial , I could execute GWT app using eclipse. I could access
Following this question I have recently asked : Understanding Document.createElement() Here is the context
Looking at the GWT sample apps and the RPC tutorial the following package conventions
I have a GWT application which I would like to run from within a
In my Google Web Toolkit project, I got the following error: com.google.gwt.user.client.rpc.SerializationException: Type ‘your.class.Type’

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.