I\'m doing the letter generation with iText (pdf/rtf) in java servlet and got a problem with accessing images. The images are in the WebContent/images folder. When I run it
Following piece of code may help you...
String path = request.getContextPath(); String split_path[] = path.split("/"); path = request.getRealPath(split_path[0]); String imagePath="\\resources\\images\\letterHead.jpg"; Image image = Image.getInstance(path+imagePath);