📄 u01d1000action.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.U01D1000bo;
import cn.hope.front.pojo.CFlevel2;
import cn.hope.front.pojo.CFourm;
import cn.hope.front.pojo.U07CommonListVO;
import cn.hope.front.util.Utility;
public class U01D1000action extends Action{
Logger log = Logger.getLogger(U01D1000action.class.getName());
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
)throws Exception{
DynaValidatorForm vform=(DynaValidatorForm) form;
String TTopicid=(String)vform.get("TTopicid");//FORM是文章的ID号
System.out.println(TTopicid);
U01D1000bo u1000bo=new U01D1000bo();
CFourm cfm=new CFourm();
cfm=u1000bo.U01D1000select(TTopicid);//得到文章的返回实体
System.out.println(cfm);//文章的返回实体
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=u1000bo.U01D1000fenserach(TTopicid, start, isEq);
System.out.println(U07comm.getCount());
HttpSession session=request.getSession();
CFlevel2 cflevel2=new CFlevel2();
cflevel2=cfm.getCFlevel2();
cflevel2.setLastRetime(Utility.getCurDateTime());//获得本论坛的最后发贴时间
u1000bo.uplastbo(cflevel2);
cfm.setTRestore(new Integer(U07comm.getCount()));//获得回帖数
u1000bo.uprestorebo(cfm);//吧回帖数UPDATE到它对应的实体中去
/*if(U07comm!=null){
session.setAttribute("fenyu1", U07comm);
}*/
session.setAttribute("cfm", cfm);//把文章实体放到SESSION里去
session.setAttribute("fenyu1", U07comm);//分页放到SESSION里去
return mapping.findForward("U01D1000");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -