• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

empty JSP page is landing

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Empty JSP is landing. My code at client side is

Webcam.snap( function(data_uri) {
dat=data_uri;//.replace("data:image/jpeg;base64,","");
document.location.href = 'display.jsp?img='+encodeURIComponent(dat);
.....
}

At server side means in display.jsp the code is like

<%
String st=request.getParameter("img");
out.println("value="+st);
System.out.println("value="+st);
java.awt.image.BufferedImage image = null;
byte[] imageByte;
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
imageByte = decoder.decodeBuffer(st);
java.io.ByteArrayInputStream bis = new java.io.ByteArrayInputStream(imageByte);
image = javax.imageio.ImageIO.read(bis);
bis.close();
if(image!= null)
javax.imageio.ImageIO.write(image, "jpg", new java.io.File("d://1.jpg"));

%>
In display.jsp I need to save captured image. The URI look like

var uri ="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQo...";

and also I'm getting exception in server

Sep 24, 2014 12:45:39 AM org.apache.coyote.http11.AbstractHttp11Processor proces
s
INFO: Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG
level.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic