1. The file default.cfg contains

server.webapp.examples.mapping=/examples
server.webapp.examples.docbase=examples

2. Yet the URL for the examples is

http://localhost:8080/examples/servlet/HelloWorldExample

3. and the actual location is

/jsdk2.1/examples/web-inf/servlets/

I don't see how this works out. How do facts 1 and 3 result in 2?
How does the servletrunner know where to look?
How can I add my own paths? Or can I?





> The readme says that the servlets are located in
> /examples/web-inf/servlets
>
> How could I deduce (and thus change) this by reading default.cfg or
> any of the properties files?
> In other words, how do I tell a configuration file where to look for
> my servlet?

Servlets are either in context/path/WEB-INF/servlets (where they're by
default accessed as /context/path/servlet/Foo) or they're in the
server's classpath.  If you look, the classpath set by the startup
script includes jsdk2.1/classes, but you can change that within the
startup script.

In default.cfg you can see how contexts are added.  Contexts can be
dirs or even other sites.  How's this one for cool:

server.app.proxy.mapping=/proxy
server.app.proxy.base=http://otherserver/

Now http://localhost:8080/proxy/index.html serves
http://otherserver/index.html.  Fun, cool, and even potentially useful
when you have a client with limited network visibility.

I think the API 2.1 getResource() abstraction facilitated this.
For more fun, picture if you write a new protocol handler what you
could do here.

server.app.db.mapping=/db
server.app.db.base=dbtp://something

Assuming you wrote a protocol handler for the "database transfer
protocol", you could as easy as this serve files coming from a db.
Exactly how URIs mapped to db queries would be known by the dbtp
handler.

-jh-

--
Jason Hunter
[EMAIL PROTECTED]
Book:    http://www.servlets.com/book
Article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

James W. Cooper
Advanced Information Retrieval and Analysis
IBM T J Watson Research Center
[EMAIL PROTECTED]
http://flahdo.watson.ibm.com/
http://www.research.ibm.com/people/j/jwcnmr/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to