I am trying to get the height and width of an image from the server's disk.
Can anyone help ?
Jonathan
My code looks like this :
=========================
public void gwImageSize(String T_IMG) {
ImageIcon img;
img = new ImageIcon(T_IMG);
width = img.getIconWidth();
height = img.getIconHeight();
}
The error looks like this :
===========================
javax.servlet.ServletException: Exception thrown on line '5' from page
'/var/JRun/servers/default/jsp1/l.jsp'.
java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.Toolkit$2.run(Toolkit.java:498)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
at javax.swing.ImageIcon.(ImageIcon.java:77)
at javax.swing.ImageIcon.(ImageIcon.java:103)
at gwdb.gwFormat.gwImageSize(gwFormat.java:123)
at jrun__l2ejsp6._jspService(jrun__l2ejsp6.java:52)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunServletPool.service(JRunServletPool.java:92)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at
allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:367)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
for interest, the JSP looks like this :
=======================================
<%@ page import="java.util.*" session="true" buffer="128kb" autoFlush="true"
isThreadSafe="false" %>
<jsp:useBean id="GWF" class="gwdb.gwFormat" scope="session"/>
<%
GWF.gwImageSize("/usr1/www/filestore/scrap/t3.jsp");
%>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
Posted from [24.132.141.8] by way of f6.law9.hotmail.com [64.4.9.6]
via Mailgate.ORG Server - http://www.Mailgate.ORG