dofundfindbyprimarykeyaction.java
来自「EJB+Struts+Webservice实现的开放式基金管理系统」· Java 代码 · 共 61 行
JAVA
61 行
package com.fund.fund.struts;
import com.fund.fund.FundDelegate;
import com.fund.fund.FundDto;
import java.util.Collection;
import java.util.ArrayList;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class DoFundFindByPrimaryKeyAction extends Action {
/**
*
* @param actionMapping ActionMapping
* @param actionForm ActionForm
* @param httpServletRequest HttpServletRequest
* @param httpServletResponse HttpServletResponse
* @return ActionForward
*/
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
FundDtoActionForm fundDtoActionForm = (FundDtoActionForm) actionForm;
try {
FundDelegate fundDelegate = new FundDelegate();
FundDto fundDto = fundDelegate.fundFindByPrimaryKey(
fundDtoActionForm.getFundNo());
Collection resultList = new ArrayList();
resultList.add(fundDto);
fundDtoActionForm.setdetailListCollection(resultList);
httpServletRequest.setAttribute("finderMethodName",
"fundFindByPrimaryKey");
httpServletRequest.setAttribute("fundDtoActionForm",
fundDtoActionForm);
} catch (Exception ex) {
httpServletRequest.setAttribute("message",
"Error while performing finder. : "
+
ex.getMessage());
return (actionMapping.findForward("unknown-error"));
}
return (actionMapping.findForward("fundFinderResultsList"));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?