JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Application Server » Tomcat  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 請問一下 Tomcat 4.1.27 的package問題!!
eric25





發文: 7
積分: 0
於 2003-08-22 22:03 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
新手入門請各位先進指導一下!
以下的檔案是書上的檔案,執行時出現以下的錯誤
,請問一下問題在那,是否要做些設定?
謝謝!
OS:win2000 pro
tomcat4.1.27

檔案如下:
1
2
3
4
5
6
7
8
9
<%-- ************** TestIso.jsp ***************** --%>
<%@
    page contentType="text/html; charset=ISO8859_1"
         import="myutil.Conv" %>
<%
String s="張三A3";
out.println("<PRE>String s   : " + s + "<BR>");
out.println("ISO-8859-1 : " + Conv.toHexString( s ));
%>

//================ Conv.java ===============
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package myutil;
import java.io.*;
public class Conv
  {
  public static String toHexString(String s)
    {
    String str="";
    for (int i=0; i<s.length(); i++)
      {
      int ch=(int)s.charAt( i );
      str=str+Integer.toHexString(ch)+" ";
      }
    return str;
    }
  }

錯誤訊息如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
HTTP Status 500 - 
 
--------------------------------------------------------------------------------
 
type Exception report
 
message 
 
description The server encountered an internal error () that prevented it from fulfilling this request.
 
exception 
 
org.apache.jasper.JasperException: Unable to compile class for JSP
 
An error occurred at line: 4 in the jsp file: /TestIso.jsp
 
Generated servlet error:
    [javac] Compiling 1 source file
 
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\howjsp\TestIso_jsp.java:7: package myutil does not exist
import myutil.Conv;
              ^
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\howjsp\TestIso_jsp.java:47: cannot resolve symbol
symbol  : variable Conv 
location: class org.apache.jsp.TestIso_jsp
out.println("ISO-8859-1 癒G " + Conv.toHexString( s ));
                               ^
2 errors
 
  at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
  at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
  at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
  at java.lang.Thread.run(Thread.java:536)


anthonycs edited on 2003-10-22 21:16
reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
2414 請問一下 Tomcat 4.1.27 的package問題!! eric25 5015 2003-08-22 22:03
2375 Re:請問一下package的問題!! psalm 74 2003-08-22 23:48
2121 Re:請問一下package的問題!! eric25 644 2003-08-23 10:22
1950 Re:請問一下package的問題!! osanaosana 44 2004-02-05 14:17
2082 Re:請問一下package的問題!! lsyong 389 2003-08-25 17:20
2144 Re:請問一下package的問題!! Yoshi 284 2003-08-25 17:32
2013 Re:請問一下package的問題!! lsyong 299 2003-08-26 11:03
2039 Re:請問一下package的問題!! popcorny 366 2003-08-26 11:46
1997 Re:請問一下package的問題!! lsyong 12 2003-08-26 11:53
» JWorld@TW »  Application Server » Tomcat

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8