?? studentowninfoaction.java
字號(hào):
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xslpackage com.huang.student.actions;import java.util.ArrayList;import java.util.HashMap;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;import com.huang.common.DB.DBtool;import com.huang.student.forms.StudentOwnInfoForm;public class StudentOwnInfoAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { StudentOwnInfoForm studentOwnInfoForm = (StudentOwnInfoForm) form; // TODO Auto-generated method stub String index = (String)request.getParameter("index"); if(index.equals("first")) { String student_id = (String)request.getSession().getAttribute("student"); ArrayList list = DBtool.getDataList("v_student",new String[]{"student_name","student_sex","dept_name","profession_name"},"student_id='"+student_id+"'"); String student_name = ((HashMap)list.get(0)).get("student_name").toString(); String student_sex = ((HashMap)list.get(0)).get("student_sex").toString(); String dept_name = ((HashMap)list.get(0)).get("dept_name").toString(); String profession_name = ((HashMap)list.get(0)).get("profession_name").toString(); request.setAttribute("student_id",student_id); request.setAttribute("student_name",student_name); request.setAttribute("student_sex",student_sex); request.setAttribute("dept_name",dept_name); request.setAttribute("profession_name",profession_name); return mapping.findForward("first"); } return null; }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -