• 大小: 2.79MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-30
  • 语言: Java
  • 标签: 网上书店  JSP  SQL  Tomcat  

资源简介

网上书店 采用JSP+SQL+Tomcat

资源截图

代码片段和文件信息

import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import bookstore.books;
import bookstore.element;
import bookstore.conn;
import bookstore.orders;
import bookstore.shopper;

public class backservlet extends HttpServlet
{

books book;

HttpSession session;
String information=null;
double totalcost=0;
int size=0;
Vector vbook=new Vector(1);
int i=0;
int bookid=0;
int orderid=0;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}

public void service(HttpServletRequest req HttpServletResponse res) throws ServletException IOException
{
req.setCharacterEncoding(“ISO-8859-1“); 
session=req.getSession(true);
res.setCharacterEncoding(“gb2312“);
String action =req.getParameter(“action“);
String exsitid=(String)session.getAttribute(“administ“);

orders orderobj;
books bookobj;
conn con=new conn();
String exsis=(String)session.getAttribute(“administer“);
if(exsis==null||!exsis.equals(“enter“))
{
res.sendRedirect(“noadminister.html“);
return;
}
if(action.equals(“add“))
{
String name=req.getParameter(“name“);
name=new String(name.getBytes(“ISO-8859-1“)“GBK“);
String author=req.getParameter(“author“);
author=new String(author.getBytes(“ISO-8859-1“)“GBK“);
String publisher=req.getParameter(“publisher“);
publisher=new String(publisher.getBytes(“ISO-8859-1“)“GBK“);
String price=req.getParameter(“price“);
String p=req.getParameter(“picture“);
p=new String(p.getBytes(“ISO-8859-1“)“GBK“);
String picture=“images/“+p;
String type=req.getParameter(“type“);
type=new String(type.getBytes(“ISO-8859-1“)“GBK“);
boolean suc=false;
suc=con.addbook(nametypepricenullauthorpicturepublisher);
if(suc)
{
session.setAttribute(“informationforupanddown“new String(“addsuc“));
res.sendRedirect(“addbook.jsp“);
}
else
{
res.sendRedirect(“addfalse.html“);//差一个错误显示的页面。
}
}
if(action.equals(“lookup“))
{
String name=req.getParameter(“name“);
name=new String(name.getBytes(“ISO-8859-1“)“GBK“);
String author=req.getParameter(“author“);
author=new String(author.getBytes(“ISO-8859-1“)“GBK“);
String publisher=req.getParameter(“publisher“);
publisher=new String(publisher.getBytes(“ISO-8859-1“)“GBK“);
String type=req.getParameter(“type“);
type=new String(type.getBytes(“ISO-8859-1“)“GBK“);
vbook.clear();
vbook=con.querybookbyinformation(nametypeauthorpublisher);
if(vbook.size()!=0)
{   
i=0;
bookobj=(books)vbook.elementAt(i);
session.setAttribute(“bookobj“bookobj);
bookid=bookobj.bookid;
size=vbook.size();
res.sendRedirect(“delbook.jsp“);
}
else
{
res.sendRedirect(“nosuchmessage.html“);
}
}
if(action.equals(“up“))
{
if(vbook==null)
{
session.setAttribute(“informationforupanddown“new

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    I.A....      7235  2007-12-15 21:11  网上书店JSP+SQL+Tomcat\addbook.jsp

    I.A....      5171  2007-12-04 19:41  网上书店JSP+SQL+Tomcat\Background\abutton4.jpg

    I.A....      5541  2007-12-04 19:41  网上书店JSP+SQL+Tomcat\Background\abutton5.jpg

    I.A....      5602  2007-12-04 19:41  网上书店JSP+SQL+Tomcat\Background\abutton6.jpg

    I.A....      4404  2007-12-01 12:58  网上书店JSP+SQL+Tomcat\Background\bg1.jpg

    I.A....      5166  2007-12-09 11:45  网上书店JSP+SQL+Tomcat\Background\brutton8.jpg

    I.A....      3836  2007-12-09 11:45  网上书店JSP+SQL+Tomcat\Background\burtton6.jpg

    I.A....      4534  2007-12-09 13:42  网上书店JSP+SQL+Tomcat\Background\buteton13.jpg

    I.A....      4963  2007-12-16 15:48  网上书店JSP+SQL+Tomcat\Background\butston3.jpg

    I.A....      4709  2007-12-16 15:48  网上书店JSP+SQL+Tomcat\Background\butston4.jpg

    I.A....      4805  2007-12-16 15:48  网上书店JSP+SQL+Tomcat\Background\butston5.jpg

    I.A....      4755  2007-12-09 13:42  网上书店JSP+SQL+Tomcat\Background\butteon12.jpg

    I.A....      3471  2007-12-04 12:24  网上书店JSP+SQL+Tomcat\Background\button10.jpg

    I.A....      3467  2007-12-04 12:24  网上书店JSP+SQL+Tomcat\Background\button11.jpg

    I.A....      3491  2007-12-04 12:24  网上书店JSP+SQL+Tomcat\Background\button12.jpg

    I.A....      3477  2007-12-04 12:24  网上书店JSP+SQL+Tomcat\Background\button13.jpg

    I.A....      4974  2007-12-09 13:42  网上书店JSP+SQL+Tomcat\Background\button14.jpg

    I.A....      5687  2007-12-04 12:30  网上书店JSP+SQL+Tomcat\Background\button17.jpg

    I.A....      5816  2007-12-04 12:30  网上书店JSP+SQL+Tomcat\Background\button18.jpg

    I.A....      6085  2007-12-04 12:30  网上书店JSP+SQL+Tomcat\Background\button19.jpg

    I.A....      5342  2007-12-04 13:01  网上书店JSP+SQL+Tomcat\Background\button2E.jpg

    I.A....      5423  2007-12-04 13:01  网上书店JSP+SQL+Tomcat\Background\button2F.jpg

    I.A....      2618  2007-12-07 21:07  网上书店JSP+SQL+Tomcat\Background\button3.jpg

    I.A....      6472  2007-12-04 13:01  网上书店JSP+SQL+Tomcat\Background\button30.jpg

    I.A....      4091  2007-12-04 13:02  网上书店JSP+SQL+Tomcat\Background\button31.jpg

    I.A....      5940  2007-12-04 13:02  网上书店JSP+SQL+Tomcat\Background\button32.jpg

    I.A....      5782  2007-12-04 13:02  网上书店JSP+SQL+Tomcat\Background\button33.jpg

    I.A....      5486  2007-12-04 13:03  网上书店JSP+SQL+Tomcat\Background\button34.jpg

    I.A....      5542  2007-12-04 13:03  网上书店JSP+SQL+Tomcat\Background\button35.jpg

    I.A....      6598  2007-12-04 13:03  网上书店JSP+SQL+Tomcat\Background\button36.jpg

............此处省略253个文件信息

评论

共有 条评论