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

📄 ggtxl_viewaction.java

📁 一段很有意义的源码,看了就知道,不信试一试啊!
💻 JAVA
字号:
/**
 * 
 */
package com.wondersgroup.txl.web.Action;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

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

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 com.wondersgroup.txl.bo.GgTxlBo;
import com.wondersgroup.txl.service.GgTxlService;
import com.wondersgroup.txl.web.Form.GgTxl_AddForm;

/**
 * @author zenggh
 *
 */
public class GgTxl_ViewAction extends Action {

private GgTxlService ggTxlService;
	
	/*
	 * Generated Methods
	 */

	public GgTxlService getGgTxlService() {
		return ggTxlService;
	}


	public void setGgTxlService(GgTxlService ggTxlService) {
		this.ggTxlService = ggTxlService;
	}


	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)  throws ParseException{
		GgTxl_AddForm add = (GgTxl_AddForm) form;// TODO Auto-generated method stub
		GgTxlBo ggTxlBo = new GgTxlBo();
	    System.out.println("view Action");
	    List list = ggTxlService.getContractGgInfo(String.valueOf(request.getParameter("id")));
		GgTxlBo tmp = (GgTxlBo) list.get(0);
		
//		Date date = null;
//		SimpleDateFormat fordate = new SimpleDateFormat("yyyy-MM-dd");
//		date = fordate.parse(tmp.getSr().toString()); //将String转换为date;
//		tmp.setSr(date);
		
	    request.setAttribute("gr", tmp);
	    
	    System.out.println("id="+request.getParameter("id")+"   xm="+tmp.getXm());
		return mapping.findForward("ggView");
	}
}

⌨️ 快捷键说明

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