[OpenMap Users] Blank Image on Servlet Example

From: Jim Schimmoeller <jschimmoeller_at_wowway.com>
Date: Tue, 24 Aug 2004 21:53:30 -0400

First, I am new to GIS / Mapping.

I downloaded openmap-4.6 and found the example ImageServlet. I have deployed
the servlet and it put some debugging statements in so I know I have a
properties file. However, when I run the servlet it completes successfully
(no errors at all) but image is blank; it is there because when I hover my
mouse over it the image toolbar shows up. I do have -Djava.awt.headless=true

Below is my servlet code. Any help would be greatly appreciated.


---------------------servlet code

import java.io.*;
import java.util.Properties;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bbn.openmap.PropertyHandler;
import com.bbn.openmap.image.MapRequestHandler;

//---Servlet that will serve up images to MDSS applications
public class ImageServlet extends HttpServlet {

      //---Setting up the object that does the image creation
      private MapRequestHandler mapRequestHandler = null;
      private Properties properties = null;

      //---First method called when servlet is loaded
      public void init(ServletConfig config) throws ServletException {
            try {
                                File f = new
                                System.out.println("File f = " + f);
                                System.out.println("exists=" + f.exists());
                                System.out.println("readable=" +
                    System.out.println("writeable=" + f.canWrite());
                    f = null;
                properties = new
                mapRequestHandler = new MapRequestHandler(properties);
            } catch (Exception e) {

      //---Handle the HTTP GET method by building a simple web page.

      public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
            String queryString = request.getQueryString();
            if(queryString == null || queryString.indexOf("REQUEST=MAP") ==
                                System.out.println("setting the default
                 queryString =
            byte arr[] = mapRequestHandler.handleRequest(queryString);

      //---Method called via a POST request
      public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
      //---Last method to be called before servlet termination (or
      public void destroy() {
            mapRequestHandler = null;
            properties = null;


[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Aug 24 2004 - 22:26:31 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:05 EDT