Sure. You just need to figure out what part of the request or response the string should make up. For instance, if you want the string to be in the body of the response, you can call response.getWriter(), and write the string with the writer.
Personally I find it much easier to work with frameworks that handle all of this for you though. Have you taken a look at RESTful frameworks? I find Jersey very nice to work with, and Spring MVC is also very powerful.
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
posted 1 year ago
Thanks and how ca we use response object outside of service() methof of servlet?