aspose file tools
The moose likes Servlets and the fly likes calling servlet from another servlet and reading response Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56224
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling servlet from another servlet and reading response
 
Similar Threads
Problem with reading servlet output
Struts 2.2.3 jasper ImageServlet problem
problem writing ImageServlet?
How to download and display a Win Word file from Blob DB field?
retrieve multiple images from mysql