Servlet

Apr 29th, 2015

image servlet example

svg

import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(urlPatterns = {"/logo.svg"})
public class LogoSvgServlet extends HttpServlet {

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {

    response.setContentType("image/svg+xml");

    String svgString =
        "<svg width=\"17\" height=\"20\" viewBox=\"0 0 17 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n"
            + "    <path d=\"M0 0H6.00019V3.82345L17 1.66667V6.66667L6.00019 8.82345V10.4901L17 8.33333V13.3333L6.00019 15.4901V20H0V0Z\" fill=\"url(#paint0_linear)\"/>\n"
            + "    <defs>\n"
            + "        <linearGradient id=\"paint0_linear\" x1=\"3.33335\" y1=\"3.08442e-08\" x2=\"8.49995\" y2=\"20\" gradientUnits=\"userSpaceOnUse\">\n"
            + "            <stop stop-color=\"#297FFF\"/>\n"
            + "            <stop offset=\"1\" stop-color=\"#7A0EE7\"/>\n"
            + "        </linearGradient>\n"
            + "    </defs>\n"
            + "</svg>";

    try (OutputStream out = response.getOutputStream()) {
      out.write(svgString.getBytes());
    }
  }
}

png

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Base64;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(urlPatterns = {"/logo.png"})
public class LogoPngServlet extends HttpServlet {

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {

    response.setContentType("image/png");

    String base64String =
        "iVBORw0KGgoAAAANSUhEUgAAAMgAAADACAIAAADOabukAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4nO2dd1gUxxvHZ69QD456cMDRpRcVC01FFEXQ2LBiL4k10Whs8ReNLX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mZmYWFhZc8Z7HjPFfAofDVVZWpqenM5mtByERiUQqVVJ76GD8N8HaWBgSAesVYkiE/wNQq9qGCGvd1gAAAABJRU5ErkJggg==";

    byte[] imageBytes = Base64.getDecoder().decode(base64String);
    InputStream is = new ByteArrayInputStream(imageBytes);

    try (OutputStream out = response.getOutputStream()) {
      byte[] buffer = new byte[1024];
      int bytesRead;
      while ((bytesRead = is.read(buffer)) != -1) {
        out.write(buffer, 0, bytesRead);
      }
    }
  }
}