Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:53:48+00:00 2026-06-03T16:53:48+00:00

I have a desktop app that creates a graphics 2D object, sticks it in

  • 0

I have a desktop app that creates a graphics 2D object, sticks it in a panel and draws it. I am trying to convert this app to a webpage using servlets and jsps. I have been reading online for 2 days and can’t wrap my head around how to do this, each example I find seems to leave out an important piece. I don’t want to save the image to file because each user will get a new/different image.

Can I create the image in the servlet along with the other response variables and pass them to the jsp at the same time? Then call the image using something like ${response.image}.This seems be preferable but doesn’t seem to work.

Or do I need a separate servlet just for the image (this seems harder)? Also how do I prepare the Graphics2D object to be used as an image in HTML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:53:51+00:00Added an answer on June 3, 2026 at 4:53 pm

    You need to understand that it’s the webbrowser who has got to download the invididual images based on the URLs of the <img> elements found in the retrieved HTML code and that it’s not the webserver who has got to inline the image’s raw content in the produced HTML code somehow.

    You really need to create a standalone image servlet for this which listens on those specific URLs of the <img> elements. You can make the servlet reuseable by providing an unique image idenfitier in the request query string or request path info during generating the HTML code.

    E.g.

    <img src="imageServlet?param1=value1&param2=value2" />
    

    with a

    @WebServlet("/imageServlet")
    public class ImageServlet extends HttpServlet {
    
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // Create image based on request.getParameter() information.
            // Set proper content type by response.setContentType().
            // Write image to response.getOutputStream().
        }
    
    }
    

    See also:

    • How to retrieve and display images from a database in a JSP page? – follows a similiar approach
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have this desktop app built using WPF and C#. It's basically an
I have one desktop application which was implemented in C#. This app uploads file
I have a desktop app that I'm making and I want users to have
We have a desktop app that allows users to fill in a questionnaire. For
I have a desktop app in Java that connects to a MySql database through
I have a project where I need to create a desktop app that acts
We have a Windows Java desktop application that creates some configuration files at %APPDATA%
I am trying to create a small desktop app that sends out e-mails to
I'm trying to create content via a small C# desktop app, and have it
I have been using SQL CE for a desktop app I am building but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.