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 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??
>
> 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?


>     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.
>


Yang Yuexiang.vcf

Reply via email to