changcy77
asked on
how Tomcat needs package name in front of the class after import?
Dear experts,
I move my application from my machine to production server running tomcat3.1 and found some codes are not working any more.
I am getting this error:
org.apache.jasper.JasperEx ception: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
E:\apps\tomcat\work\localh ost_8080%2 Fpolym\_00 02falign_0 002dresult _00033_000 2ejspalign _0002dresu lt3_jsp_0. java:89: Class Hashtable not found.
Hashtable ad = (Hashtable)request.getAttr ibute("dis clist");
If I add package name in front of the Hashtable, it will work. So, why the import statement not working?
<%@ page
import="java.util.*"
import="java.io.*"
import="java.lang.Math"
errorPage="ExceptionHandle r.jsp"
%>
Thanks. Is this a Tomcat 3 problem?
I move my application from my machine to production server running tomcat3.1 and found some codes are not working any more.
I am getting this error:
org.apache.jasper.JasperEx
E:\apps\tomcat\work\localh
Hashtable ad = (Hashtable)request.getAttr
If I add package name in front of the Hashtable, it will work. So, why the import statement not working?
<%@ page
import="java.util.*"
import="java.io.*"
import="java.lang.Math"
errorPage="ExceptionHandle
%>
Thanks. Is this a Tomcat 3 problem?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Aha! Thanks kennethxu. I though it might be something like that, but I haven't used anything earlier than Tomcat 4, so it would only have been a guess if I had posted that ;-)
changcy77, split the points - 20 each - I might have provided a solution, but kennethxu actually explained it ;-)
changcy77, split the points - 20 each - I might have provided a solution, but kennethxu actually explained it ;-)
ASKER
sorry, both of your answer did not work...
for <%@ page import="java.util.*, import="java.io.*, import="java.lang.Math" %>
error messages are :
org.apache.jasper.JasperEx ception: /login.jsp(4,0) Unterminated <%@ page tag
at org.apache.jasper.compiler .DefaultEr rorHandler .jspError( DefaultErr orHandler. java:94)
at org.apache.jasper.compiler .ErrorDisp atcher.dis patch(Erro rDispatche r.java:428 )
at org.apache.jasper.compiler .ErrorDisp atcher.jsp Error(Erro rDispatche r.java:170 )
at org.apache.jasper.compiler .
************************** ********** ********** ******
for <%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
error message is
org.apache.jasper.compiler .ParseExce ption: E:\login.jsp(5,4) Invalid directive
at org.apache.jasper.compiler .Parser$Di rective.ac cept(Parse r.java:186 )
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1073 )
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1038 )
at org.apache.jasper.compiler .Parser.pa rse(Parser .java:1034 )
at org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:182)
for <%@ page import="java.util.*, import="java.io.*, import="java.lang.Math" %>
error messages are :
org.apache.jasper.JasperEx
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
**************************
for <%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
error message is
org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
login.jsp shouldn't be in E:\ It should be in the webapps\polym directory along with your other JSPs.
my bad, didn't check exactly
>> <%@ page import="java.util.*, import="java.io.*, import="java.lang.Math" %>
this is incorrect and it should be:
<%@ page import="java.util.*, java.io.*, java.lang.Math" %>
if you still have problem, post your code and we'll fix it for you.
>> <%@ page import="java.util.*, import="java.io.*, import="java.lang.Math" %>
this is incorrect and it should be:
<%@ page import="java.util.*, java.io.*, java.lang.Math" %>
if you still have problem, post your code and we'll fix it for you.
I have just tested on Tomcat 3.2 and 3.3 ( don't have 3.1 on hand) both import works!
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%=new Date() %><p>
<%=new IOException( "works?" )%>
-- or --
<%@ page import="java.io.*, java.util.*" %>
<%=new Date() %><p>
<%=new IOException( "works?" )%>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%=new Date() %><p>
<%=new IOException( "works?" )%>
-- or --
<%@ page import="java.io.*, java.util.*" %>
<%=new Date() %><p>
<%=new IOException( "works?" )%>
ASKER