⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directaction.java

📁 使用java开发的简易论坛
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package mokoda.action;

import java.util.List;

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

import mokoda.entity.Client;
import mokoda.entity.ForumDAO;

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;

/** 
 * MyEclipse Struts
 * Creation date: 12-23-2006
 * 
 * XDoclet definition:
 * @struts.action
 */
public class DirectAction extends Action {
	/*
	 * Generated Methods
	 */

	/**
	 * Method execute
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String path = request.getParameter("path");
		if(path.equals("/admin/assignhost.jsp")){
			List frms = ForumDAO.getAllForums();
			request.setAttribute("frms", frms);
			return new ActionForward(path);
		}
		Object o = null;
		request.setAttribute("id", o = request.getParameter("id"));
		Client client = (Client) request.getSession().getAttribute("client");
		if (client == null) {
			request.setAttribute("inputPath", path);
			ActionErrors errors = new ActionErrors();
			errors.add("errors", new ActionError("errors.need.login"));
			saveErrors(request, errors);
			return mapping.findForward("login");
		} else {
			return new ActionForward(path);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -