• 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

sending image from servelt to SVG file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
i'm trying to send the image from servlet to SVG file. but file is not transfering correctly. i think there is some encoding problem in the servlet. also the svg does not display the image.
my servelet code is :
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class testImageSend extends HttpServlet {
private static final String CONTENT_TYPE = "image/jpg";
//Initialize global variables
public void init() throws ServletException {
//
//
//
//Read the default paths for diferent modules from the DBase here
//
//
//
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//
//PUT SECURITY CHECKS HERE
//
//

response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
String FilePath = new String("E:/chataan1.jpg");

try{
FileReader reader = new FileReader(FilePath);
Reader htmlFileReader = reader;
BufferedReader in = new BufferedReader(htmlFileReader);
String input = "";
while((input = in.readLine())!= null){
out.println(input);
}
in.close();
}
catch(Exception e){
e.printStackTrace();
}
}

//Clean up resources
public void destroy() {
}
}

my svg file code is :
<svg width="680" height="400" zoomAndPan="disable" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">


<image id="bg" xlink:href="http://wes09:8001/servlet/testImageSend.class" x="52" y="25" width="126" height="47" fill="blue"/>



</svg>

well if some one have the solution , plz tell me.
looking for ur reply.
Regards
Ather
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic