Hi, I am getting crazy on loading an image from a file saved on a
"custom" folder on the server.
The folder layout is such that we have: "web/WEB_INF". My image files
are in "web/upload" for no particular reason, I can put them anywhere
I want.
Depiste this, I cannot figure out how to load images! Examples are
related to files that are in source folders (and I cannot do this) and
other examples just create a custom BufferedImage.
I have tried with this code:
final String uriString = "/upload/" + pathname;
File file = new File("");
BufferedDynamicImageResource resource = new
BufferedDynamicImageResource();
try {
file = new File(".", uriString);
BufferedImage image = ImageIO.read(file);
resource.setImage(image);
} catch (IOException ex) {
LogFactory.getLog(getClass()).info("pathname " +
pathname);
LogFactory.getLog(getClass()).info("IO Exception: " +
file);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user