I have a jsp page that displays an image. Before I display the image I determine its height and width so I can scale it so it is not distorted.
Here is my code.
Image image = Toolkit.getDefaultToolkit().getImage(directPath + File.separator + SysConst.albumDirectory + File.separator + compName + File.separator + album.getName() + File.separator + p.getPhotoName());
height = image.getHeight(null);
width = image.getWidth(null);
It works on my local machine but not the web host. With the web host I get the following error.
exception
javax.servlet.ServletException: sun/awt/motif/MToolkit
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java)
Here is my code.
Image image = Toolkit.getDefaultToolkit().getImage(directPath + File.separator + SysConst.albumDirectory + File.separator + compName + File.separator + album.getName() + File.separator + p.getPhotoName());
height = image.getHeight(null);
width = image.getWidth(null);
It works on my local machine but not the web host. With the web host I get the following error.
exception
javax.servlet.ServletException: sun/awt/motif/MToolkit
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java)