📄 bbscontentsaction.java
字号:
/**
* 查看BBS内容的Action Bean
* BBSContentsAction.java
* @author usr
*/
package building;
import java.util.*;
import javax.sql.*;
import javax.servlet.http.*;
import javax.servlet.ServletContext;
import org.apache.struts.action.*;
public final class BBSContentsAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
DynaActionForm bbsIdForm = (DynaActionForm)form;
Integer bbsId = (Integer)bbsIdForm.get("bbsId");
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Constants.DATASOURCE_KEY);
DB db = new DB(dataSource);
HttpSession session = request.getSession();
session.setAttribute(Constants.BBS_CONTENTS_KEY,BBS.getOneInfo(db,bbsId.intValue()));
session.setAttribute(Constants.BBS_NEXT_KEY,BBSnext.getInfoByBBSID(db,bbsId.intValue()));
String PageForward = "toBBSContents";
db.close();
return(mapping.findForward(PageForward));
}//End of execute
}//End of class BBSContentsAction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -