Is it a good practice to send these objects or shall i write the code here itself.
Within your
servlet class it is ok, but it is a questionable practice to pass request and response references to other classes because these are container managed objects. Sloppy programming can leave your code hanging on to a request or response longer than it should.
Instead of passing request to another class, use the javax.servlet.ServletRequest getParameterMap method and pass the resulting Map. By working with a Map you will have code that can be tested outside the servlet environment.
Bill