selectfwxxaction.java

来自「北大青鸟的租房网练习文件」· Java 代码 · 共 38 行

JAVA
38
字号
package com.newer.web.actions;

import java.util.Vector;

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

import org.apache.commons.beanutils.BeanUtils;
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.newer.dao.SelectDao;
import com.newer.entity.SelectVO;

public class SelectFwxxAction extends DispatchAction {
	public ActionForward select(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForm actionform=(ActionForm)form;
		BeanUtils bean=new BeanUtils();
		SelectVO selectVO=new SelectVO();
		bean.copyProperties(selectVO, actionform);
		SelectDao select=new SelectDao();
		Vector vc=select.getFwxxByCondition(selectVO);
		if(vc==null||vc.size()==0){
			//查询的数据不存在
			request.setAttribute("msg", "没有跟您所录入的查询条件相对应的房屋<a href='javascript:history.back()'>返回继续查找</a>");
			return mapping.findForward("notExist");
		}else{
			request.setAttribute("vc", vc);
			return mapping.findForward("list");
		}
	}

}

⌨️ 快捷键说明

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