我想用JCreator来编译这样子一个java文件,除了安装jdk外,还需要什么配置操作呢?

wulingdongliu 2006-02-10 07:15:47
希望大家指点我




import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloServlet extends HttpServlet
{
public void service( HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
{
//Get the user抯 name from request parameters
String userName = request.getParameter("userName");

PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<body>");
pw.println("<h3>Hello " + userName + "</h3>");
pw.println("</body>");
pw.println("</html>");
}
}
...全文
36 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wulingdongliu 2006-02-11
谢谢指点!
回复
wsk_228 2006-02-11
因为你这个是sevlety就要加sevlet包.这个在Tomcat中能找到。你装一下Tomcat后在lib中就有了。然后配到JCreator中就行了。
回复
js_chenmj 2006-02-11
要加sevlet包
回复
wulingdongliu 2006-02-10
可是我现在编译的时候出错,出错信息如下:
--------------------Configuration: <Default>--------------------
C:\HelloServlet.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
C:\HelloServlet.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
C:\HelloServlet.java:7: cannot resolve symbol
symbol : class HttpServlet
location: class HelloServlet
public class HelloServlet extends HttpServlet
^
C:\HelloServlet.java:9: cannot resolve symbol
symbol : class HttpServletRequest
location: class HelloServlet
public void service( HttpServletRequest request,
^
C:\HelloServlet.java:10: cannot resolve symbol
symbol : class HttpServletResponse
location: class HelloServlet
HttpServletResponse response)
^
C:\HelloServlet.java:11: cannot resolve symbol
symbol : class ServletException
location: class HelloServlet
throws ServletException,
^
6 errors

Process completed.
回复
Paripatetic 2006-02-10
购了
JCreator不需配置
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2006-02-10 07:15
社区公告
暂无公告