Properties file in servlet
what is properties file in servlets? explain its significance?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
AartiPosted Nov 17, 2011, 12:12 AM
The Servlet Property File
Properties are stored in a text file with a default name of servlet.properties(You can specify it another name when you start ServletRunner.) The file holds the properties for all the servlets that servletrunner will run.
Here is the servlet.properties file for the Bookstore example:
# This file contains the properties for the Bookstore servlets.
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
Thanks.
Vikas MishraPosted Nov 18, 2011, 11:22 PM
AartiPosted Nov 17, 2011, 12:30 AM
Please refer the below link.
http://tynamo.qindesign.com/docs/tini/props.html#servlet.propsFile
Regards
Aarti
Priya LingePosted Nov 16, 2011, 11:36 PM
ServletProperties: Gives the location of a file containing properties for your servlets.
The path can be absolute or relative to Apache's server root and, if not specified, defaults to
conf/servlets.properties
Many properties can be set within the properties file. Arguments can be passed to all servlets with the statement:
servlets.default.initArgs=arg1=val1,arg2=val2,...
Arguments can be passed to individual servlets as follows:
servlet.servletname.initArgs=arg1=val1,arg2=val2,...
The sixth and final step is to fire up Apache. Well, you should be ready to go at this point, so go into the /sbin directory of your Apache tree and start up the server:
cd /usr/local/apache/sbin
./apachectl start
Please check below link.
http://www.linuxjournal.com/article/3119
http://java.sun.com/developer/onlineTraining/Servlets/Fundamentals/servlets.html
Hope this will help you.
Thanks.