GeeCON Prague 2014*
The moose likes Servlets and the fly likes calling servlet from another servlet and reading response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "calling servlet from another servlet and reading response" Watch "calling servlet from another servlet and reading response" New topic
Author

calling servlet from another servlet and reading response

coooolmagic Magic
Greenhorn

Joined: Nov 11, 2010
Posts: 2
Hi All

I have a servlet (ImageServlet) with doGet method. This servlet returns a PNG image as response.

I have a situation where I need to call this ImageServlet from another servlet.

I want to read the response of ImageServlet in this servlet and put that image into an excel sheet which i am creating using POI API.

Pleashelp me as I am struggling to find the solution.

I am not getting it that how would I get hold of response as an image.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

coooolmagic Magic wrote:I have a situation where I need to call this ImageServlet from another servlet.

This is indicative of a design issue. Rather than trying to call one servlet from another, factor the common code out into a utility class that both servlets can use.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: calling servlet from another servlet and reading response