?? article.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");}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -