• 大小: 10KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Java
  • 标签: java  

资源简介

简单的书店java代码

资源截图

代码片段和文件信息

/*
 * To change this template choose Tools | Templates
 * and open the template in the editor.
 */
package bookShop;

import java.util.Vector;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Administrator
 */
public class BookShopBean { 
    private String item;
    private String submit;
    
    Vector v=new Vector();
    
    public String getItem() {
        return item;
    }
    public void setItem(String item){
        this.item=item;
    }  
    public String getSubmit() {
        return submit;
    }
   public void setSubmit(String submit){
        this.submit=submit;
    }    
   
    private void addItem(String item){
        v.addElement(item);
    }
    public String[] getItems(){
        String[] s=new String[v.size()];
        v.copyInto(s);
        return s;
    }
    public void processRequest(HttpServletRequest request){
     System.out.println(“购买00“);
     System.out.println(submit);
     if(submit==null)
            addItem(item);
        if(submit.equals(“goumai“))
         {System.out.println(“购买“); 
            addItem(item);}
        //鎵╁睍閮ㄥ垎
         else if (submit.equals(“shanchu“))
            removeItem(item);
        reset();
    }
    private void reset()    {
        setSubmit(null);
        setItem(null);
    }
    //鎵╁睍閮ㄥ垎
    private void removeItem(String name){
        v.removeElement(name);
    }
}

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

     文件        834  2014-10-08 10:09  beantest\.classpath

     文件       1041  2014-10-08 10:09  beantest\.project

     文件        503  2014-10-08 10:09  beantest\.settings\.jsdtscope

     文件         57  2014-10-08 11:15  beantest\.settings\org.eclipse.core.resources.prefs

     文件        364  2014-10-08 10:09  beantest\.settings\org.eclipse.jdt.core.prefs

     文件        476  2014-10-08 10:09  beantest\.settings\org.eclipse.wst.common.component

     文件        345  2014-10-08 10:09  beantest\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2014-10-08 10:09  beantest\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2014-10-08 10:09  beantest\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       1985  2014-10-08 11:33  beantest\build\classes\bookShop\BookShopBean.class

     文件        735  2014-10-08 11:15  beantest\build\classes\bookShop\UserInfoBean.class

     文件        758  2014-10-08 11:15  beantest\build\classes\com\mycompany\bean\IntrospectionBean.class

     文件       1469  2014-10-08 11:33  beantest\src\bookShop\BookShopBean.java

     文件        809  2014-10-08 11:14  beantest\src\bookShop\UserInfoBean.java

     文件        375  2014-10-08 10:27  beantest\src\com\mycompany\bean\IntrospectionBean.java

     文件       1258  2014-10-08 11:32  beantest\WebContent\bookShop\bookShop.jsp

     文件        849  2014-10-08 11:35  beantest\WebContent\bookShop\bookShopCheck.jsp

     文件       1111  2014-10-08 11:12  beantest\WebContent\bookShop\bookShopLogin.jsp

     文件       1176  2014-10-08 11:12  beantest\WebContent\bookShop\bookShopLoginCheck.jsp

     文件        614  2014-10-08 11:03  beantest\WebContent\Input.jsp

     文件        572  2014-10-08 11:08  beantest\WebContent\Introspection.jsp

     文件         39  2014-10-08 10:09  beantest\WebContent\meta-INF\MANIFEST.MF

     目录          0  2014-10-08 10:10  beantest\build\classes\com\mycompany\bean

     目录          0  2014-10-08 10:09  beantest\build\classes\com\mycompany

     目录          0  2014-10-08 10:10  beantest\src\com\mycompany\bean

     目录          0  2014-10-08 11:14  beantest\build\classes\bookShop

     目录          0  2014-10-08 10:09  beantest\build\classes\com

     目录          0  2014-10-08 10:09  beantest\src\com\mycompany

     目录          0  2014-10-08 10:09  beantest\WebContent\WEB-INF\lib

     目录          0  2014-10-08 11:14  beantest\build\classes

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

评论

共有 条评论