<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    waysun一路陽光

    不輕易服輸,不輕言放棄.--心是夢的舞臺,心有多大,舞臺有多大。踏踏實實做事,認認真真做人。

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理 ::
      167 隨筆 :: 1 文章 :: 64 評論 :: 0 Trackbacks
    1.首先是一個頁面的調用
    <html:form action="softevaluate/scoreSet" method="POST">
    <html:link action="softevaluate/scoreSet.do?do=setScore" paramName="Info" paramProperty="scoreId" paramId="scoreId">
    </html:form>
    2.Action事件響應
    public class ScoreSetAction extends DispatchAction
    {
           
    /****************************************************************/
    /****打分參數設置 添加 2008-04-11 14:59***/
     public ActionForward setScore(ActionMapping mapping, ActionForm form,
       HttpServletRequest request, HttpServletResponse response)
       throws Exception {
      /******************************************************************/
      /**添加 從數據庫獲得參數,去掉最高分,去掉最低分*/
        String maxscore = "";
        String minscore = "";   
        SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
        org.hibernate.classic.Session session = sessionFactory.openSession();
        Query query =session.createQuery("from ScoreViable");
        List users=query.list();
        session.close();
        sessionFactory.close();
        for (ListIterator iterator = users.listIterator(); iterator.hasNext(); )
        {
         ScoreViable user = (ScoreViable) iterator.next();
         //System.out.println(user.getBeforCount() +"Age: " + user.getEndCount()+"http:///");
         maxscore=user.getBeforCount()+"";
         minscore=user.getEndCount()+"";
        }
        String []st=new String[2];
        st[0]=maxscore;
        st[1]=minscore;
    /****為bean   ScoreViable 賦值**********/
        ScoreViable scoreViable=new ScoreViable();
        scoreViable.setBeforCount(new Long(maxscore));
        scoreViable.setEndCount(new Long(minscore));
        request.setAttribute("scoreViable", scoreViable);

      /***********************************************************************************/
      return mapping.findForward("setScore");
     }
    }

    3.在另外的的頁面使用bean
      <logic:present name="scoreViable" scope="request"> 
      <tr>
        <td width="200" class=content><div align="right">去掉最高分個數:</div></td> 
        <bean:define id="beforCount" name='scoreViable' property='beforCount' /> 
        <td width="200" class=content><input type="text" name="maxscore" value="<%=beforCount%>"/></td>
        <td width="200" class=content></td>
        <td width="200" class=content></td>
      </tr>
      <tr>
        <td width="200" class=content><div align="right">去掉最低分個數:</div></td>
        <bean:define id="endCount" name='scoreViable' property='endCount' />
        <td width="200" class=content><input type="text" name="minscore" value="<%=endCount%>"/></td>
        <td width="200" class=content></td>
        <td width="200" class=content></td>
      </tr>
      </logic:present>
    4.ScoreViable.
    java  JAVA BEAN

    ublic class ScoreViable implements java.io.Serializable {

        // Fields   
         private Long id;
         private Long beforCount;
         private Long endCount;
     
        // Constructors
        /** default constructor */
        public ScoreViable() {
        }
     /** minimal constructor */
        public ScoreViable(Long id, Long beforCount, Long endCount) {
            this.id = id;
            this.beforCount = beforCount;
            this.endCount = endCount;
        }
       
        /** full constructor */

      
        // Property accessors
        public Long getId() {
            return this.id;
        }
       
        public void setId(Long id) {
            this.id = id;
        }
        public Long getBeforCount() {
            return this.beforCount;
        }
       
        public void setBeforCount(Long beforCount) {
            this.beforCount = beforCount;
        }
        public Long getEndCount() {
            return this.endCount;
        }
       
        public void setEndCount(Long endCount) {
            this.endCount = endCount;
        }
    }

    5.struts-config.xml
      <action attribute="scoreSetForm" name="scoreSetForm"
       parameter="do" path="/softevaluate/scoreSet" scope="request"
       type="com.gpdi.softevaluate.action.ScoreSetAction">
       <forward name="list" path="/softevaluate/scoreSetList.jsp" />
       <forward name="scorelist" path="/softevaluate/scoreList.jsp" />   
       <forward name="add" path="/softevaluate/scoreSetPropertyManage.jsp" /> 
       <forward name="edit" path="/softevaluate/scoreSetPropertyManage.jsp" />
       <forward name="saveAdd" path="/softevaluate/scoreSet.do?do=list" /> 
       <forward name="setScore" path="/softevaluate/scoreCountSet.jsp" /> 
       <forward name="importScore" path="/softevaluate/scoreCountSet.jsp" /> 
          <forward name="DelList"
        path="/softevaluate/scoreSet.do?do=list" /> 
      
    </action> 
    posted on 2008-06-20 08:39 weesun一米陽光 閱讀(205) 評論(0)  編輯  收藏 所屬分類: 總結備用
    主站蜘蛛池模板: 2021在线永久免费视频| 丝瓜app免费下载网址进入ios| 91青青国产在线观看免费| 亚洲热线99精品视频| 国产精品免费在线播放| 国产精品亚洲玖玖玖在线观看| 香港经典a毛片免费观看看| 亚洲AⅤ永久无码精品AA | 成人亚洲性情网站WWW在线观看| 国产亚洲精彩视频| 亚洲乱码中文字幕综合234| 成人av片无码免费天天看| 亚洲国产精品VA在线看黑人| 久久狠狠躁免费观看| 亚洲美女视频免费| 啦啦啦高清视频在线观看免费 | 亚洲第一精品福利| 嘿嘿嘿视频免费网站在线观看| 亚洲国产电影在线观看| 免费特级黄毛片在线成人观看| 黄页网址在线免费观看| 国产亚洲福利精品一区| 99re热精品视频国产免费| 麻豆狠色伊人亚洲综合网站| 国产色婷婷精品免费视频| 中文字幕的电影免费网站| 亚洲喷奶水中文字幕电影| 四虎影在线永久免费观看| 国精产品一区一区三区免费视频| 亚洲精品中文字幕麻豆| 国产午夜鲁丝片AV无码免费| 在线观看免费黄色网址| 亚洲人成电影网站| 亚洲精品无码永久在线观看| 久久综合国产乱子伦精品免费| 亚洲一区二区三区高清在线观看| 亚洲欧洲中文日韩av乱码| 国产精品色拉拉免费看| 鲁啊鲁在线视频免费播放| 亚洲自偷自拍另类12p| 国产亚洲精品免费|