Raw binary data cannot be passed in a parameter. The normal way of handling this is to first encode (Base64 or Hex say) the binary data before sending it as a parameter and then to decode it in the Servlet. BUT - since the data seems to be an image and is likely to be longer than can be sent as a parameter you should consider sending it as the body of a POST then no encoding is required.
Joined: Nov 13, 2010
This is my getters and setters in a java class. how do i pass it to servlet request parameter
What's doing the passing? As already pointed out, you'll need to encode it in BASE64, set all the right headers, and pass it as the POST body of a multipart request with appropriate separators.
If it's being sent from a browser, a multi-part form and file input element will do this automatically. Otherwise, you'll need to find out all about the necessary format. There may be support for such things in 3rd party libraries such as HttpClient, but I'm not sure.