findfoodaction.java

来自「struts+spring+hibernate的例子」· Java 代码 · 共 41 行

JAVA
41
字号
package com.meagle.action;

import java.util.List;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.meagle.forms.FoodForm;

public class FindFoodAction extends BaseAction {
	/**
	 * Default constructor
	 */
	public FindFoodAction() {
		super();
	}

	/**
	 * Implementation for Struts execute
	 */
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		javax.servlet.http.HttpServletRequest request,
		javax.servlet.http.HttpServletResponse response)
		throws java.lang.Exception {

		// Assemble the food from the form

		FoodForm oForm = (FoodForm) form;

		// delegate the save to the service layer and further upstream
		List foods = getFoodService().findFoodByName(oForm.getName());	
		

		return mapping.findForward("success");

	}
}

⌨️ 快捷键说明

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