comments included.

hope this helps,

- james

#YANG YUE XIANG# wrote:

> Hi, James
>
> Thanks for your information.
>
> But for the servlet engine of JSDK, I cannot understand following
> concepts although I can run my servlets in my computer now.
>
> yang
>
> James Wrote:
> > in jsdk2.1 there is the notion of a
> > "webapp" (or context).
>
> Problem 1: How to understand this concept?

you'll be fine if you just want all your content to be served from
a single web application context, for example the webpages
context. this is the default (server docbase) web app context for
jsdk 2.1.

if, on the other hand, you'd like to add more web application contexts
(the examples web application context is an example) you are free to
do so by simply:

    adding the appropriate physical file/directory structures (WEB-INF, etc)

    adding the appropriate "webapp" entries to default.cfg

>
>
>  >you can add as many webapps to your servlet
> > as you'd like by adding a pair of the following lines for each webapp:
> >
> > server.webapp.AppId.mappping=/AppURL
> > server,webapp.AppId.docbase=AppDir
>
> Problem 2: How to understand "mapping" ,"docbase", /AppURL and AppDir??

from the perspective of the server, the mapping associates inbound requests to
the correspoding physical file system docbase with which the subsequent response

will (most likely) be served up.

>
> >
> > a webapp directory structure consists of a couple of specific
> sub-directory
> > structures (i won't go into detail here unless you have further
> questions)
> > with which you can use the webpages or examples directory structures
> > provided with jsdk2.1 as examples.
> >
> > for example:
> >
> > copy (recursively) webpages to foo and bar.
> >
> > add the following to default.cfg
> >
> >     server.webapp.foo.mapping=/foo
> >     server.webapp.foo.docbase=foo
> >
> >     server.webapp.bar.mapping=/bar
> >     server.webapp.bar.docbase=bar
> >
> > start the server and you should be able to make requests as follows:
> >
> >     http://localhost:8080/ <http://localhost:8080/>                   maps
> to webpage/index.html file
>
> Problen 3: Does
>
>   http://localhost:8080/webpage <http://localhost:8080/webpage>
>
> map to webpage/index.html ? Why not?

the default mapping is "/" and maps to the server docbase "webpages"

the default jsdk2.1 is not configured with a "webpages" mapping so
such a request is invalid.

i don't recommend you do this ... if you add a "webpages" directory
under the jsdk2.1/webpages directory then the request you specified
above would be serviceable by accessing the <jsdk2.1>/webpages/webpages
physical file system.


>
>
> >     http://localhost:8080/examples <http://localhost:8080/examples>
> maps to examples/index.html file
> >     http://localhost:8080/foo <http://localhost:8080/foo>
> maps to foo/index.html file
> >     http://localhost:8080/bar <http://localhost:8080/bar>
> maps to bar/index.html file
> >
> > now, servlets which reside in any of the afore mentioned webapps can
> > be accessed via:
> >
> >     http://localhost:8080/servlet/FooServlet
> <http://localhost:8080/servlet/FooServlet>
> >                                                      maps to
> > webpages/WEB-INF/servlet/FooServlet
> >     http://localhost:8080/examples/servlet/FooServlet
> <http://localhost:8080/examples/servlet/FooServlet>
> >                                                      maps to
> > examples/WEB-INF/servlet/FooServlet
> >     http://localhost:8080/foo/servlet/FooServlet
> <http://localhost:8080/foo/servlet/FooServlet>
> >                                                      maps to
> > foo/WEB-INF/servlet/FooServlet
> >     http://localhost:8080/bar/servlet/FooServlet
> <http://localhost:8080/bar/servlet/FooServlet>
> >                                                      maps to
> > bar/WEB-INF/servlet/FooServlet
> >
> > so, place your ServletTest in any of the afore mentioned servlet
> specified
> > directories and you should be able to access it accordingly.
> >

___________________________________________________________________________
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