?? bookspageaction.java
字號(hào):
/*<%--////////////////////////////////////////////////////GTON原創(chuàng)作品-Struts圖書館管理系統(tǒng)//////////////////////////////////////////////////////////////
////////////所用技術(shù):jsp2.0+servlet2.4+jstl1.1+Struts1.2+sqlserver2000+tomcat5.5/////////////////////////////////////
/////////////////////////////////////////////////////專業(yè)制作網(wǎng)站 專業(yè)制作畢業(yè)設(shè)計(jì)////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////QQ:27612285//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////Mail:punkwang@126.com////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////WEB:www.98202.com www.630cn.com//////////////////////////////////////////////////////
////////////////////////////////////////////////////qq群:20665503////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////求高薪工作一個(gè)有意者聯(lián)系本人/////////////////////////////////////////////////////////
////////////////////////////////////////////////////Phone:010-81110277(王先生)///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--%>
<%--接 畢業(yè)設(shè)計(jì)業(yè)務(wù) 網(wǎng)站業(yè)務(wù) 商業(yè)網(wǎng)站 個(gè)人網(wǎng)站 商城系統(tǒng) 企業(yè)主頁(yè) JSP ASP.net PHP !!!
業(yè)務(wù)種類
網(wǎng)站業(yè)務(wù): 商業(yè)網(wǎng)站 個(gè)人網(wǎng)站 商城系統(tǒng) 企業(yè)主頁(yè) 等中小型網(wǎng)站(asp, jsp ,php ,asp.net)
畢業(yè)設(shè)計(jì)業(yè)務(wù):java(j2ee j2se) vb delphi php .net等畢設(shè)業(yè)務(wù)
模塊業(yè)務(wù):各種中小型模塊 java .net
如有需要 價(jià)格細(xì)談 QQ:27612285
我的網(wǎng)站
HTTP://www.98202.com
HTTP://www.do3w.com
HTTP://www.201cn.com
HTTP://www.630cn.com--%>
*/package com.gton.action.user;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
import com.gton.bean.*;
import com.gton.bean.db.*;
import com.gton.tookit.*;
import java.util.*;
import java.io.*;
public class BooksPageAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
int page=1;
int count=10;
int pagecount=0;
String sqlStr="";
String seach="";
String bookTypeID="0";
String seachstr="";
if(request.getParameter("seachstr")!=null&&request.getParameter("seachstr").length()>0)
{
try {
seachstr = new String(request.getParameter("seachstr").getBytes("8859_1"),"GB2312");
System.out.println(seachstr);
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
}
}
if(request.getParameter("page")!=null&&request.getParameter("page").length()>0)
{
page=Integer.parseInt(request.getParameter("page"));
}
if(request.getParameter("seach")!=null&&request.getParameter("seach").length()>0)
{
seach=request.getParameter("seach");
if(seach.equals("1"))
{
sqlStr="where Books_Name like '%"+seachstr+"%'";
}else if(seach.equals("2"))
{
sqlStr="where Books_Company like '%"+seachstr+"%'";
}else if(seach.equals("3"))
{
sqlStr="where Books_Company like '%"+seachstr+"%' or Books_Name like '%"+seachstr+"%'";
}
}
if(request.getParameter("bookTypeID")!=null&&request.getParameter("bookTypeID").length()>0)
{
bookTypeID=request.getParameter("bookTypeID");
}
if(sqlStr.equals(""))
{
if(!bookTypeID.equals("0"))
sqlStr="where BookType_ID="+bookTypeID;
}else
{
if(!bookTypeID.equals("0"))
sqlStr+="and BookType_ID="+bookTypeID;
}
DataBean db=new DataBean();
ArrayList list=db.getBooksList(count,page,sqlStr);
System.out.println(list.size());
db.Close();
request.setAttribute("list",list);
request.setAttribute("page",page+"");
request.setAttribute("pagecount",db.pagecount+"");
request.setAttribute("bookTypeID",bookTypeID);
request.setAttribute("seach",seach);
request.setAttribute("seachstr",seachstr);
return MyForward.forward(mapping.findForward("index"),"?action=1");
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -