[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    Re: Slide Servlet
From:       Dirk Verbeeck <dirk.verbeeck () pandora ! be>
Date:       2001-07-30 19:20:22
[Download RAW message or body]

Bita Shadgar wrote:

> Hi,
> I am trying to write servlet with slide for a webdav server like
> mod_dav.
> However I don't know in which folder I should put my .class files,
> then with which URL I can see the result of my servlet.
>
> For example, I tried to put SimpleServlet.class in
> /home.../slide/server/webapps/slide/WEB-INF/  and see it by
> Http://mymachine:8080/slide/SimpleServlet. But it gave me:
>
> HTTP Status 404 - /slide/SimpleServlet
> The requested resource (/slide/SimpleServlet) is not available.
>
> In fact, I don't know how to map my servlet files to URLs.
> Indeed, Could you please let me know what the path and War-URL are in
> 'Listed applications for virtual host localhost ' page
> (http://mymachine:8080/manager/slide),
> and what are their role and format. I tried many times with many
> different format of
> path and War-URL, however all the times I received :
>
> FAIL - Invalid application URL http://mymachine:8080/sampleAddress was specified.
>
> Bita Shadgar.
>

Single class files go in the classes directory and if you jar them the
jar goes into the lib directory;
examples/WEB-INF/classes/SimpleServlet.class or
examples/WEB-INF/lib/simple.jar

To access you servlet use
http://mymachine:8080/examples/servlet/SimpleServlet
or define a servlet mapping in examples/WEB-INF/web.xml
  <servlet>
    <servlet-name>myservlet</servlet-name>
    <servlet-class>SimpleServlet</servlet-class>
    <init-param>
      <param-name>myparam</param-name>
      <param-value>myvalue</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>myservlet</servlet-name>
    <url-pattern>/the-url-I-need</url-pattern>
  </servlet-mapping>

If you want to put an extra servlet in the slide application you have to
add a mapping because the slide servlet already takes the whole url
space.

For more info:
http://jakarta.apache.org/site/faqs.html


Dirk

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic