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

» JWorld@TW » Servlet/JSP 討論區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
作者 Unable to compile class for JSP如何解決[以解決]
as0955344054





發文: 107
積分: 0
於 2013-10-27 16:17 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
我想請問一下我連結CLASS檔轉移到另一個網頁後取值發生問題

請問一下正規的程式PO法 下面白底要怎麼PO 知道了馬上從編輯 因為不知道去哪找跟下那些關鍵字所以只好在此發問

class檔內容如下

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
package system;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
 
public class testhttp extends HttpServlet{
  public testhttp() {
  }
 
  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    String url ="/related_tool.jsp";
    ServletContext sc = getServletContext();
    HttpSession session = req.getSession();
    String testint = "100";
    req.setAttribute("testint", testint);
    session.setAttribute("testint", testint);
    RequestDispatcher rd = sc.getRequestDispatcher(url);
    rd.forward(req, resp);
  }
  
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
  
    doPost(req,resp);
  }
}

以下為錯誤資訊

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
type Exception report
 
message Unable to compile class for JSP:
 
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: 115 in the jsp file: /related_tool.jsp
testint cannot be resolved to a type
1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2: <%@ page contentType="text/html; charset=Big5" import = "java.sql.*"%>--->
3: <html xmlns="http://www.w3.org/1999/xhtml">
 
An error occurred at line: 116 in the jsp file: /related_tool.jsp
Duplicate local variable out
1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2: <%@ page contentType="text/html; charset=Big5" import = "java.sql.*"%>--->
3: <html xmlns="http://www.w3.org/1999/xhtml">
 
An error occurred at line: 116 in the jsp file: /related_tool.jsp
Syntax error on token ".", ; expected
1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2: <%@ page contentType="text/html; charset=Big5" import = "java.sql.*"%>--->
3: <html xmlns="http://www.w3.org/1999/xhtml">
 
An error occurred at line: 116 in the jsp file: /related_tool.jsp
The method write(String) is undefined for the type related_005ftool_jsp
1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2: <%@ page contentType="text/html; charset=Big5" import = "java.sql.*"%>--->
3: <html xmlns="http://www.w3.org/1999/xhtml">
 
Stacktrace:
  org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
  org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
  org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:467)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:606)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  system.testhttp.doPost(testhttp.java:19)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

CLASS檔中轉移到另一個網頁有成功 但是卻無法讀取出需要的東西請問問題在哪裡!?[


as0955344054 edited on 2013-10-31 19:34
reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
8352 Unable to compile class for JSP如何解決[以解決] as0955344054 3826 2013-10-27 16:17
8181 Re:Unable to compile class for JSP如何解決 chuanchu 79 2013-10-27 22:35
8166 Re:Unable to compile class for JSP如何解決 as0955344054 57 2013-10-28 15:40
8130 Re:Unable to compile class for JSP如何解決 chuanchu 42 2013-10-28 15:50
8147 Re:Unable to compile class for JSP如何解決 as0955344054 21 2013-10-28 17:33
8094 Re:Unable to compile class for JSP如何解決 chuanchu 10 2013-10-28 20:37
8144 Re:Unable to compile class for JSP如何解決 as0955344054 61 2013-10-28 21:08
8220 Re:Unable to compile class for JSP如何解決 as0955344054 28 2013-10-31 19:34
8147 Re:Unable to compile class for JSP如何解決 cjc1010 110 2013-10-28 10:17
» JWorld@TW »  Servlet/JSP 討論區

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