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

📄 popedomlistaction.java

📁 一套完整的档案管理系统
💻 JAVA
字号:
package com.stsc.archive.manage;

import javax.servlet.http.*;
import org.apache.struts.action.*;
import java.util.Properties;

import org.apache.struts.util.MessageResources;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;

public final class PopedomListAction extends Action
{
	public ActionForward perform(ActionMapping mapping,
		ActionForm form, HttpServletRequest req,
		HttpServletResponse res)
	{
		System.out.println("Start perform(" + form + ") . . ." );
		
		Properties dbBase = new Properties();
        dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
        
        STPoolDataSet data = new STPoolDataSet();
        String sql = "SELECT * FROM fRole";
        System.out.println("begin PopedomListAction...");
        STResultSet rs = data.getSTResult(sql, dbBase);
        System.out.println("end PopedomListAction");
        
        PopedomList popedomList = new PopedomList();
        
        while(rs!=null && rs.next()) 
        {
        	Popedom popedom = new Popedom();
        	
        	popedom.setRoleId(rs.getInt("RoleID"));
        	popedom.setPopedom(rs.getString("Role"));
            
            popedomList.addPopedom(popedom);
            
            System.out.println(rs.getString("Role"));
        }
        
        // Save our logged-in user in the session
		HttpSession session = req.getSession();
        session.setAttribute("popemlist", popedomList);
        
        // Remove the obsolete form bean
		if (mapping.getAttribute() != null) 
		{
            if ("request".equals(mapping.getScope()))
                req.removeAttribute(mapping.getAttribute());
            else
                session.removeAttribute(mapping.getAttribute());
        }
       
        return mapping.findForward("popedomList");
	}
}

⌨️ 快捷键说明

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