📄 showscoreaction.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.online.actions;import com.online.pojo.User;import com.online.service.*;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.util.*;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;import org.apache.struts.action.ActionForward;import javax.servlet.http.HttpSession;/** * * @author Administrator */public class ShowScoreAction extends org.apache.struts.action.Action { /* forward name="success" path="" */ private final static String SUCCESS = "success"; private int uid; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session=request.getSession(); User user = (User)session.getAttribute("us"); List score=new ArrayList(); ScoreService scoreValue=new ScoreService(user.getUid()); score=scoreValue.getScoreCollection(); System.out.println(score.size()); session.setAttribute("score",score); return mapping.findForward("success"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -