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

📄 article.java

📁 新闻发布系统
💻 JAVA
字号:
/*
 * Article.java
 *
 * Created on 2007年3月24日, 上午8:51
 */

package News.Struts.Action;

import News.Common.News;
import News.ProcessData.SingleRecordModel;
import java.util.Hashtable;
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.ActionMapping;
import org.apache.struts.action.ActionForward;
/**
 *
 * @author Owner
 * @version
 */

public class Article extends Action {
    

    
    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param form The optional ActionForm bean for this request.
     * @param request The HTTP Request we are processing.
     * @param response The HTTP Response we are processing.
     * @throws java.lang.Exception
     * @return
     */
    public ActionForward execute(ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        SingleRecordModel srm=new SingleRecordModel();
        News data=new News();
        Hashtable ht=srm.NewsRecord(request.getParameter("ID"));
        if(ht!=null)
        {
           data.setId((String)ht.get("ID"));
           data.setTitle((String)ht.get("Title"));
           data.setAuthor((String)ht.get("Author"));
           data.setModifyTime((String)ht.get("ModifyTime"));
           data.setContent((String)ht.get("Content"));
           data.setCatalogName((String)ht.get("CatalogName"));
           request.getSession(true).setAttribute("News",data);
           return mapping.findForward("article");
        }else {    return mapping.findForward("failure");}
        
    }
}

⌨️ 快捷键说明

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