I made a /header
folder in the web pages directory in Netbeans and added an image named header.png
. Now I want to access this image file in a servlet using the following code:
BufferedImage image = ImageIO.read(getClass().getResource(" /header/header.png"));
But this is not happening, it gives the following error:
java.lang.IllegalArgumentException: input == null!
Below is my project's directory structure:
How is this error caused and how can I solve it?