?? tofileuploadaction.java
字號:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.david.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.jgroups.protocols.MPING;
import com.david.bo.Category;
import com.david.bo.Userinfo;
import com.david.service.ICategoryService;
import com.david.util.IParseRequest;
/**
* MyEclipse Struts
* Creation date: 10-20-2007
*
* XDoclet definition:
* @struts.action validate="true"
* @struts.action-forward name="goto" path="/form/fileUpload.jsp"
*/
public class ToFileUploadAction extends FilterRequestAction {
/*
* Generated Methods
*/
private ICategoryService categoryService;
private IParseRequest parseRequest;
public void setParseRequest(IParseRequest parseRequest) {
this.parseRequest = parseRequest;
}
public void setCategoryService(ICategoryService categoryService) {
this.categoryService = categoryService;
}
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward doExecute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
int categoryId=parseRequest.parseInt(request, "categoryId", 0);
//ICategoryService categoryService=(ICategoryService)this.getBean("categoryService");
Category category=categoryService.getCategoryById(categoryId);
List<Category> categories=categoryService.getCategories((Userinfo)request.getSession().getAttribute("USERINFO"));
request.setAttribute("category", category);
request.setAttribute("categories", categories);
return mapping.findForward("goto");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -