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

📄 hintaction.java

📁 基于J2EE的办公自动化系统。实现流程定义流程办理等。运用了hibernate+struts+spring框架综合运用的系统。
💻 JAVA
字号:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xsl

package com.oa.module.hints;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;

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.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.oa.module.office.user.Tuser;

/** 
 * MyEclipse Struts
 * Creation date: 01-26-2008
 * 
 * XDoclet definition:
 * @struts.action path="/hint" name="hintForm" input="/Jsp_file/user/sethint.jsp" scope="request" validate="true"
 */
public class HintAction extends DispatchAction {

	// --------------------------------------------------------- Instance Variables
	private HintsDAO hintdao ;
	// --------------------------------------------------------- Methods

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward editshow(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) {
		HintForm hintForm = (HintForm) form;
		HttpSession session = request.getSession();
		Tuser user = (Tuser) session.getAttribute("user");
		Map map = hintdao.getHintsByUserId(user.getUno());
		hintForm.setHshowtype((String) map.get("hshowtype"));
		hintForm.setHaffair((String) map.get("haffair"));
		hintForm.setHmeeting((String)map.get("hmeeting"));
		hintForm.setHemail((String)map.get("hemail"));
		request.setAttribute("hint",map);
		return mapping.findForward("editshow");
	}
	
	/** 
	 * Method update
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws IOException 
	 */
	public ActionForward update(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) throws IOException {
		HintForm hintForm = (HintForm) form;
		PrintWriter out = response.getWriter();
		String contextPath = request.getContextPath();
		if (hintdao.updateHints(hintForm)){
			
			out.print("<script>");
			out.print("alert('修改个人贴士成功!');");
			out.print("top.topFrame.location.href ='"+contextPath+"/login.do?method=settop';");
			out.print("location.href ='"+contextPath+"/login.do?method=main';");
			out.print("</script>");
		}else{
			out.print("<script>");
			out.print("alert('修改个人贴士失败!');");
			out.print("history.back();");
			out.print("</script>");
		}
		return null;
	}

	public HintsDAO getHintdao() {
		return hintdao;
	}

	public void setHintdao(HintsDAO hintdao) {
		this.hintdao = hintdao;
	}

}

⌨️ 快捷键说明

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