request.getRequestDispatcher等一批函数都不能用,编译出错

ck4 2002-04-28 01:21:59
错误信息如下:
F:\develop\tomcat\seaskyOffice\WEB-INF\classes>javac com\seaskysoft\servlets\*.j
ava
com\seaskysoft\servlets\ActionUtils.java:36: cannot resolve symbol
symbol : method getRequestDispatcher (java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
RequestDispatcher rd = request.getRequestDispatcher(url);
^
com\seaskysoft\servlets\DispatcherServlet.java:36: cannot resolve symbol
symbol : variable request
location: class com.seaskysoft.servlets.DispatcherServlet
HttpSession session=request.getSession();
^
com\seaskysoft\servlets\DispatcherServlet.java:39: cannot resolve symbol
symbol : method setAttribute (java.lang.String,com.seaskysoft.manager.userBean
)
location: interface javax.servlet.http.HttpSession
session.setAttribute("user",user);
^
com\seaskysoft\servlets\DispatcherServlet.java:109: cannot resolve symbol
symbol : method getAttribute (java.lang.String)
location: interface javax.servlet.http.HttpSession
if (session.getAttribute("user").getIsLoged==true) {
^
Note: com\seaskysoft\servlets\LoginAction.java uses or overrides a deprecated AP
I.
Note: Recompile with -deprecation for details.
4 errors
是怎么回事?
...全文
26 点赞 收藏 8
写回复
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dylanwolf 2002-04-29

classpath 不对吧, 没有include 相应的包。
回复
gzwrj 2002-04-29
You must update your servlet.jar to version2.x or later.
回复
kkhui 2002-04-29
javac -classpath %TOMCAT_HOME%/lib/servlet.jar;. ActionUtils.java
回复
ck4 2002-04-28
package com.seaskysoft.servlets;

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

/**
* This class contains utility methods used by the Action objects
* in the Project Billboard application.
*
* @author Hans Bergsten, Gefion software <hans@gefionsoftware.com>
* @version 1.0
*/
public class ActionUtils {

public String getShowPageURL(HttpServletRequest request, String page) {
return request.getContextPath() + request.getServletPath() +
"?action=showPage&page=" + page;
}
public void forward(String url, HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
RequestDispatcher rd = request.getRequestDispatcher(url);
rd.forward(request, response);
}
}

这是其中一个,RequestDispatcher rd = request.getRequestDispatcher(url);出错,request.getContextPath()也出错,说unresolved symbol.包应该没问题了吧。我可是全都包含近来了。
回复
可乐加水 2002-04-28
相应的包你包含进来了吗
回复
leonzhao 2002-04-28
我建议你把程序貼上来看看。
回复
ck4 2002-04-28
leonzhao(灯泡) :
我用的是jdk1.4,tomcat3.2。怎么回事啊,实在是搞不懂!
回复
leonzhao 2002-04-28
我编译成功了啊?!!

你是不是搞错了?
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告