当前位置: 技术问答>java相关
request.getRequestDispatcher等一批函数都不能用,编译出错
来源: 互联网 发布时间:2015-05-20
本文导语: 错误信息如下: F:developtomcatseaskyOfficeWEB-INFclasses>javac comseaskysoftservlets*.j ava comseaskysoftservletsActionUtils.java:36: cannot resolve symbol symbol : method getRequestDispatcher (java.lang.String) location: interface javax.servlet.http.HttpServletRe...
错误信息如下:
F:developtomcatseaskyOfficeWEB-INFclasses>javac comseaskysoftservlets*.j
ava
comseaskysoftservletsActionUtils.java:36: cannot resolve symbol
symbol : method getRequestDispatcher (java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
RequestDispatcher rd = request.getRequestDispatcher(url);
^
comseaskysoftservletsDispatcherServlet.java:36: cannot resolve symbol
symbol : variable request
location: class com.seaskysoft.servlets.DispatcherServlet
HttpSession session=request.getSession();
^
comseaskysoftservletsDispatcherServlet.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);
^
comseaskysoftservletsDispatcherServlet.java:109: cannot resolve symbol
symbol : method getAttribute (java.lang.String)
location: interface javax.servlet.http.HttpSession
if (session.getAttribute("user").getIsLoged==true) {
^
Note: comseaskysoftservletsLoginAction.java uses or overrides a deprecated AP
I.
Note: Recompile with -deprecation for details.
4 errors
是怎么回事?
F:developtomcatseaskyOfficeWEB-INFclasses>javac comseaskysoftservlets*.j
ava
comseaskysoftservletsActionUtils.java:36: cannot resolve symbol
symbol : method getRequestDispatcher (java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
RequestDispatcher rd = request.getRequestDispatcher(url);
^
comseaskysoftservletsDispatcherServlet.java:36: cannot resolve symbol
symbol : variable request
location: class com.seaskysoft.servlets.DispatcherServlet
HttpSession session=request.getSession();
^
comseaskysoftservletsDispatcherServlet.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);
^
comseaskysoftservletsDispatcherServlet.java:109: cannot resolve symbol
symbol : method getAttribute (java.lang.String)
location: interface javax.servlet.http.HttpSession
if (session.getAttribute("user").getIsLoged==true) {
^
Note: comseaskysoftservletsLoginAction.java uses or overrides a deprecated AP
I.
Note: Recompile with -deprecation for details.
4 errors
是怎么回事?
|
我编译成功了啊?!!
你是不是搞错了?
你是不是搞错了?
|
You must update your servlet.jar to version2.x or later.
|
classpath 不对吧, 没有include 相应的包。
|
javac -classpath %TOMCAT_HOME%/lib/servlet.jar;. ActionUtils.java