Topic: 急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!)

  Print this page

1.急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) Copy to clipboard
Posted by: xiaoliu
Posted on: 2005-06-16 18:08

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class show extends HttpServlet
{
  public void doget(HttpServletRequest req,HttpServletResponse res) throws IOException
{
PrintWriter out=res.getWrite;
r();
res.setContentType("text/html;charset=GB2312");//设置响应的类型。

out.println("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'");
out.println("'http://www.w3.org/TR/html4/loose.dtd'>");
    out.println("<html>");
    out.println("<head>");
    out.println("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>");
   out.println("<title>ccccddfgbnbvfffv</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<img src='img\\wang.jpg' width='283' height='212'>");
    out.println("</body>");
    out.println("</html>");
}
}

2.Re:急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) [Re: xiaoliu] Copy to clipboard
Posted by: xiaoliu
Posted on: 2005-06-16 18:10

出错提示:多谢各位了!!!
--------------------Configuration: <Default>--------------------
G:\jsp_sam\WEB-INF\classes\show.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
G:\jsp_sam\WEB-INF\classes\show.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
G:\jsp_sam\WEB-INF\classes\show.java:4: cannot resolve symbol
symbol : class HttpServlet
location: class show
public class show extends HttpServlet
^
G:\jsp_sam\WEB-INF\classes\show.java:6: cannot resolve symbol
symbol : class HttpServletRequest
location: class show
public void doget(HttpServletRequest req,HttpServletResponse res) throws IOException
^
G:\jsp_sam\WEB-INF\classes\show.java:6: cannot resolve symbol
symbol : class HttpServletResponse
location: class show
public void doget(HttpServletRequest req,HttpServletResponse res) throws IOException
^
G:\jsp_sam\WEB-INF\classes\show.java:9: cannot resolve symbol
symbol : method r ()
location: class show
r();
^
6 errors

Process completed.

3.Re:急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) [Re: xiaoliu] Copy to clipboard
Posted by: chengbd
Posted on: 2005-06-16 22:20

package javax.servlet does not exist
import javax.servlet.*;

还没编译过去,servlet.jar包找不到

4.Re:急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) [Re: chengbd] Copy to clipboard
Posted by: xiaoliu
Posted on: 2005-06-17 11:25

多谢版主了,我试试看!

5.Re:急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) [Re: xiaoliu] Copy to clipboard
Posted by: mhlovers
Posted on: 2005-06-29 11:44

servlet.jar包找不到

6.Re:急啊:大家来帮忙看一下哪里出错了!(Servlet程序:输入图片的!) [Re: xiaoliu] Copy to clipboard
Posted by: zixuan
Posted on: 2005-07-01 19:59

在j2ee.jar里面撒!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923