58,454
社区成员
发帖
与我相关
我的任务
分享
package com.turing.framework.action;
import java.util.Map; //The import java.util.Map cannot be resolved
import javax.servlet.http.HttpServletRequest;
//The import javax.servlet.http.HttpServletRequest cannot be resolved
import javax.servlet.http.HttpServletResponse; //同上
import javax.servlet.http.HttpSession; //同上
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
public class MyAction extends DispatchAction {
//The hierarchy of the type MyAction is inconsistent
@Override //Override cannot be resolved to a type
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception {//Multiple markers at this line
HttpSession session = request.getSession();//HttpSession cannot be resolved to a type
Map map = (Map)session.getAttribute("user");//- Map cannot be resolved to a type
if( map == null ){
request.setAttribute("error", "您还没有登录,请重新登录后,再试!");
return mapping.findForward("cuowu");
}
return super.execute(mapping, form, request, response);//The method findForward(String) from the type ActionMapping refers to the missing type String
}
}