Skip to main content
added 279 characters in body
Source Link
Bogdan
  • 24.3k
  • 3
  • 71
  • 63

You can't change the request, but you could wrap it. See the following question for more details: Why do we wrap HttpServletRequest ? The api provides an HttpServletRequestWrapper but what do we gain from wrapping the request?

You will need to put a servlet filter in front of your servlet to make the wrapping work.

As for how to remove that part from the content, you could do it with plain old string manipulations from what the String class offers, or with something like StringUtils, or you could parse the JSONparse the JSON with a library of your choice, remove that property, then write it back as a string.

You can't change the request, but you could wrap it. See the following question for more details: Why do we wrap HttpServletRequest ? The api provides an HttpServletRequestWrapper but what do we gain from wrapping the request?

You will need to put a servlet filter in front of your servlet to make the wrapping work.

As for how to remove that part from the content, you could do it with plain old string manipulations or you could parse the JSON with a library of your choice, remove that property, then write it back as a string.

You can't change the request, but you could wrap it. See the following question for more details: Why do we wrap HttpServletRequest ? The api provides an HttpServletRequestWrapper but what do we gain from wrapping the request?

You will need to put a servlet filter in front of your servlet to make the wrapping work.

As for how to remove that part from the content, you could do it with plain old string manipulations from what the String class offers, or with something like StringUtils, or you could parse the JSON with a library of your choice, remove that property, then write it back as a string.

Source Link
Bogdan
  • 24.3k
  • 3
  • 71
  • 63

You can't change the request, but you could wrap it. See the following question for more details: Why do we wrap HttpServletRequest ? The api provides an HttpServletRequestWrapper but what do we gain from wrapping the request?

You will need to put a servlet filter in front of your servlet to make the wrapping work.

As for how to remove that part from the content, you could do it with plain old string manipulations or you could parse the JSON with a library of your choice, remove that property, then write it back as a string.