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

📄 u01d100action.java

📁 持久层hibernate技术使用的一个例子
💻 JAVA
字号:
package cn.hope.front.action;



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

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
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.validator.DynaValidatorForm;




import cn.hope.front.bo.U01D100bo;
import cn.hope.front.pojo.CFourm;
import cn.hope.front.pojo.U07CommonListVO;

public class U01D100action extends Action{
	Logger log = Logger.getLogger(U01D100action.class.getName());
	public ActionForward execute(
			ActionMapping mapping,
			ActionForm form,
			HttpServletRequest request,  
			HttpServletResponse response
			)throws Exception{
		
		DynaValidatorForm vform=(DynaValidatorForm) form;
		
		String  TSortid=(String)vform.get("TSortid");//获得论坛ID
		String  TSortd=request.getParameter("TSortid");//获得论坛ID
		String TSortname=request.getParameter("TSortname");//获得论坛的名字
		
		System.out.println(TSortname);
		
		System.out.println(TSortd);
		System.out.println(TSortid);
		U01D100bo d100bo=new U01D100bo();
		
		CFourm cf=new CFourm();	
		cf=d100bo.U01D100fourmbo(TSortid);//获得文章的实体
		
		System.out.println(cf);
		HttpSession session=request.getSession();
		 session.setAttribute("D100",cf);//吧实体放到SESSION中
		 
		 U07CommonListVO U07comm=new U07CommonListVO();//分页
		 	int start = 0;
			boolean isEq = false;
			
			if (StringUtils.isNotEmpty(request.getParameter("start"))) {
					start = Integer.parseInt(request.getParameter("start"));
				}
				if (StringUtils.isNotEmpty(request.getParameter("isEq"))) {
					isEq = true;
				}	
						
		 U07comm=d100bo.serach(TSortid, start, isEq);
		 
		 session.setAttribute("TSortd",TSortd);
		 
		 session.setAttribute("fenyu",
				 U07comm);//吧分页发信息放到SESSION中去。
		 
		 session.setAttribute("TSortname",
				 TSortname);//吧获得论坛的名字放到SESSION中

		return mapping.findForward("U01D100");
			
		
	}

}

⌨️ 快捷键说明

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