online auction
1.0.0

賣方可以添加產品圖像。圖像保存在戰爭之外的服務器的本地文件系統上。圖像名稱保存在與產品相對應的數據庫中。可以將tomcat配置為從磁盤上的任何地方讀取文件,並在特定的URL上使用它們。
在conf/server.xml文件中添加Context標籤, docBase屬性是本地文件系統上文件夾的絕對路徑,tomcat將使用path屬性來訪問該文件夾。確保Tomcat具有讀/編寫指定位置的權限。
< Host appBase = " webapps "
autoDeploy = " false " name = " localhost " unpackWARs = " true "
xmlNamespaceAware = " false " xmlValidation = " false " >
...
< Context docBase = " /Users/sanul/Documents/uploads/ " path = " /media " />
</ Host >例如,如果我將myImage.jpg存儲在/Users/sanul/Documents/uploads/ folder,則使用tomcat服務器,我可以使用以下鏈接在瀏覽器中訪問該文件
http://localhost:8080/media/myImage.jpg
server.xml注意:創建文件夾以在工作區外上載圖像。
$ cd OnlineAuction/src/com/auctivity/utility
$ vim DBConnection.java添加德比URL,用戶名和密碼
con = DriverManager . getConnection ( url , username , password );$ cd OnlineAuction/src/com/auctivity/controller
$ vim AddProductController.java將BASE_DIR添加為圖像上傳文件夾路徑中的dopost方法
String BASE_DIR = "/Users/sanul/Documents/" ;運行/OnlineAuction/AuctivitySchema.sql
.
├── AuctivitySchema.sql
├── WebContent
│ ├── META-INF
│ │ └── MANIFEST.MF
│ ├── WEB-INF
│ │ ├── properties
│ │ │ └── log4j.properties
│ │ └── web.xml
│ ├── accounts
│ │ ├── login.jsp
│ │ ├── profile.jsp
│ │ └── registration.jsp
│ ├── buyer
│ │ └── buyerHistory.jsp
│ ├── common
│ │ ├── footer.jsp
│ │ └── navbar.jsp
│ ├── error
│ │ ├── comingSoon.jsp
│ │ ├── forbiddenAccessError.jsp
│ │ └── pageNotFoundError.jsp
│ ├── index.jsp
│ ├── resources
│ │ ├── css
│ │ │ ├── accounts
│ │ │ │ ├── login.css
│ │ │ │ ├── profile.css
│ │ │ │ └── registration.css
│ │ │ ├── buyer
│ │ │ │ └── buyerPagePurchasedProducts1.css
│ │ │ ├── home.css
│ │ │ ├── seller
│ │ │ │ ├── SellerNavbar.css
│ │ │ │ ├── SellerPage.css
│ │ │ │ └── addProducts.css
│ │ │ └── style.css
│ │ ├── img
│ │ │ └── logo.jpg
│ │ └── js
│ │ ├── accounts
│ │ │ ├── login.js
│ │ │ └── register.js
│ │ ├── buyer
│ │ ├── home.js
│ │ ├── index.js
│ │ ├── seller
│ │ │ ├── addProducts.js
│ │ │ └── scheduleAuction.js
│ │ └── utility
│ │ └── inputValidation.js
│ └── seller
│ ├── addProduct.jsp
│ ├── scheduleAuction.jsp
│ └── sellerHistory.jsp
├── derby.log
└── src
└── com
└── auctivity
├── controller
│ ├── AddProductController.java
│ ├── BuyerHistoryController.java
│ ├── DefaultController.java
│ ├── ExceptionController.java
│ ├── LogOutController.java
│ ├── LoginController.java
│ ├── ProfileController.java
│ ├── RegistrationController.java
│ ├── ScheduleAuctionController.java
│ └── SellerHistoryController.java
├── exceptions
│ ├── ForbiddenAccessException.java
│ ├── InsufficientBalanceException.java
│ ├── InvalidDataFormatException.java
│ └── UserNotFoundException.java
├── model
│ ├── beans
│ │ ├── Bid.java
│ │ ├── Category.java
│ │ ├── Product.java
│ │ ├── ProductForAuction.java
│ │ └── User.java
│ ├── dao
│ │ ├── IProductDao.java
│ │ ├── IProductSchedulerDao.java
│ │ ├── IUserDao.java
│ │ ├── ProductDaoImpl.java
│ │ ├── ProductSchedulerDaoImpl.java
│ │ └── UserDaoImpl.java
│ └── service
│ ├── IProductSchedulerService.java
│ ├── IProductService.java
│ ├── IUserService.java
│ ├── ProductSchedulerServiceImpl.java
│ ├── ProductServiceImpl.java
│ └── UserServiceImpl.java
└── utility
├── ContextListener.java
├── DBConnection.java
├── InputValidation.java
├── MyTimerTask.java
├── ObjectFactory.java
└── PasswordEncrypter.java