⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listprojectaction.java

📁 本人课程设计时做的一个用struts框架实现的基于cmmi2的项目管理系统的原型。还有部分功能尚未实现
💻 JAVA
字号:
package com.cmmi2pms.sa.project;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpSession;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;/**  * AddprojectAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 04-12-2004 *  * XDoclet definition: * @struts:action path="/addproject" name="addProjectForm" input="/pages/SA/project/addproject.jsp" validate="true" * @struts:action-forward name="/pages/failure.htm" path="/pages/failure.htm" redirect="true" * @struts:action-forward name="/pages/success.htm" path="/pages/success.htm" redirect="true" */public class ListProjectAction extends Action {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method execute	 * @param ActionMapping mapping	 * @param ActionForm form	 * @param HttpServletRequest request	 * @param HttpServletResponse response	 * @return ActionForward	 * @throws Exception	 */	public ActionForward perform(ActionMapping mapping,			ActionForm form,			HttpServletRequest request,			HttpServletResponse response)	throws IOException, ServletException {				StringBuffer message =						  new StringBuffer("ListProjectAction called");		servlet.log(message.toString());						Project[] projectList = null;				try{			ProjectList theProjectList = new ProjectList();						theProjectList.getAllProject();			projectList = theProjectList.getProjects();		}		catch (Exception e){			System.out.println("Exception is throwed from getAllProjectList:"+e.getMessage());		}				message = new StringBuffer("ProjectList.getAllProject() called");				servlet.log(message.toString());				System.out.println("theProjectList length:" + projectList.length);			for (int i=0; i < projectList.length;i++)		{			System.out.print(projectList[i].getId() + "    ");			System.out.print(projectList[i].getProjectID()+ "    ");			System.out.println(projectList[i].getProjectName());		}		    				HttpSession session = request.getSession();		session.setAttribute("projectList",projectList );				return (mapping.findForward("SUCCESS"));		//throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented.");	}		}

⌨️ 快捷键说明

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