|
|
|
|||
|
Setting Servlet PropertiesProperties are key-value pairs used for the configuration, creation and
initialization of a servlet. For example,
The
The code PropertyThe value of the
servlet.bookdb.code=database.BookDBServlet
The The initargs PropertyThe value of the
servlet.bookdb.initArgs=\
dbfile=servlets/DatabaseData
Multiple initialization parameters are specified as a comma-delimited
list. For example, if the database servlet connected to a real database,
its initial arguments might look like this:
servlet.bookdb.initArgs=\
user=duke,\
password=dukes_password,\
url=fill_in_the_database_url
The Property FileProperties are stored in a text file with a default name of
# This file contains the properties for the Duke's Bookstore servlets.
# Duke's Book Store -- main page
servlet.bookstore.code=BookStoreServlet
# The servlet that manages the database of books
servlet.bookdb.code=database.BookDBServlet
# View all the books in the bookstore
servlet.catalog.code=CatalogServlet
# Show information about a specific book
servlet.bookdetails.code=BookDetailServlet
# See the books that you've chosen to buy
servlet.showcart.code=ShowCartServlet
# Collects information for buying the chosen books
servlet.cashier.code=CashierServlet
# Provide a receipt to the user who's bought books
servlet.receipt.code=ReceiptServlet
| |||
|