| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 568 人关注过本帖
标题:求大家帮帮忙,我是个初学JSP的新手
取消只看楼主 加入收藏
linshanjiang
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-4-7
收藏
 问题点数:0 回复次数:1 
求大家帮帮忙,我是个初学JSP的新手

各位朋友,我是个初学jsp的新手,请各位帮帮忙,我用JCreator执行这个servlet总会有很多的错误,执行别的servlet也会有类似的错误,谁能给我解释一下阿!代码如下:
package test;
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  public class Test extends HttpServlet {
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  PrintWriter out=response.getWriter();
  out.println("<html><body><h1>This is a servlet test.</h1></body></html>");
  out.flush();
  }
  }
错误如下:
C:\test\Test.java:2: illegal character: \12288
  import java.io.IOException;
^
C:\test\Test.java:2: illegal character: \12288
  import java.io.IOException;
^
C:\test\Test.java:3: illegal character: \12288
  import java.io.PrintWriter;
^
C:\test\Test.java:3: illegal character: \12288
  import java.io.PrintWriter;
^
C:\test\Test.java:4: illegal character: \12288
  import javax.servlet.ServletException;
^
C:\test\Test.java:4: illegal character: \12288
  import javax.servlet.ServletException;
^
C:\test\Test.java:5: illegal character: \12288
  import javax.servlet.http.HttpServlet;
^
C:\test\Test.java:5: illegal character: \12288
  import javax.servlet.http.HttpServlet;
^
C:\test\Test.java:6: illegal character: \12288
  import javax.servlet.http.HttpServletRequest;
^
C:\test\Test.java:6: illegal character: \12288
  import javax.servlet.http.HttpServletRequest;
^
C:\test\Test.java:7: illegal character: \12288
  import javax.servlet.http.HttpServletResponse;

^
C:\test\Test.java:7: illegal character: \12288
  import javax.servlet.http.HttpServletResponse;
^
C:\test\Test.java:8: illegal character: \12288
  public class Test extends HttpServlet
^
C:\test\Test.java:8: illegal character: \12288
  public class Test extends HttpServlet
^
C:\test\Test.java:10: illegal character: \12288
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
^
C:\test\Test.java:10: illegal character: \12288
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
^
C:\test\Test.java:11: illegal character: \12288
  throws ServletException, IOException
^
C:\test\Test.java:11: illegal character: \12288
  throws ServletException, IOException
^
C:\test\Test.java:13: illegal character: \12288
  PrintWriter out=response.getWriter();
^
C:\test\Test.java:13: illegal character: \12288
  PrintWriter out=response.getWriter();
^
C:\test\Test.java:14: illegal character: \12288
  out.println("<html><body><h1>This is a servlet test.</h1></body></html>");
^
C:\test\Test.java:14: illegal character: \12288
  out.println("<html><body><h1>This is a servlet test.</h1></body></html>");
^
C:\test\Test.java:15: illegal character: \12288
  out.flush();
^
C:\test\Test.java:15: illegal character: \12288
  out.flush();
^
C:\test\Test.java:16: illegal character: \12288
  }
^
C:\test\Test.java:16: illegal character: \12288
  }
^
C:\test\Test.java:17: illegal character: \12288
 }
^
C:\test\Test.java:17: <identifier> expected
 }
^
28 errors

搜索更多相关主题的帖子: JSP 初学 
2007-04-08 15:13
linshanjiang
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-4-7
收藏
得分:0 
谢谢各位~~~~
2007-04-09 22:34
快速回复:求大家帮帮忙,我是个初学JSP的新手
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097258 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved