src/com/office/action/LogoffAction.java

(完整代码) 1KB

package com.office.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.office.actionform.LogonForm;

public class LogoffAction extends Action {
	public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
		ActionErrors errors=new ActionErrors();
		HttpSession session=request.getSession();
		LogonForm logonuser=(LogonForm)session.getAttribute("logonuser");
	    if(logonuser==null){
			 errors=new ActionErrors();
			 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("office.logon.notallow"));
			 saveErrors(request,errors);
			 return mapping.findForward("notallowlogon");
		}
		session.invalidate();
		String mark=mapping.getParameter();
		if(mark.equals("logon_agin"))
			return mapping.findForward("logon_agin");
		else
			return mapping.findForward("logoff");
	}
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。