invoker finds servlets only in the current directory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

invoker finds servlets only in the current directory

sunj
Hi, I'd like to invoke servlets located other than the current directory,
but couldn't figure out how to do it.
   

     // another servlet context
        {
            // Create a context
            HttpContext context = new HttpContext();
            context.setContextPath("/svt/*");
            server.addContext(context);

            // Create a servlet container -- i.e. handler
            ServletHandler servlets = new ServletHandler();
            context.addHandler(servlets);

            // Map a servlet onto the container
            // http://kiki:8787/svt/hello
            servlets.addServlet("HelloServlet", "/hello/*", "HelloServlet");

            // http://kiki:8787/svt/servlet/BeckyServlet
            // where BekcyServlet is in the current directory
            servlets.addServlet("Invoker", "/servlet/*",
                "org.mortbay.jetty.servlet.Invoker");
        }


thanks
sunj
Reply | Threaded
Open this post in threaded view
|

Re: invoker finds servlets only in the current directory

Greg Wilkins-5

You have to have the current directory on the classpath (or create a context
classloader that can load from it).

But using the invoker servlet is a VERY BAD was of calling servlets.
It exposes too much information in the URL .

regards


sunj (sent by Nabble.com) wrote:

> Hi, I'd like to invoke servlets located other than the current directory,
> but couldn't figure out how to do it.
>    
>
>      // another servlet context
>         {
>             // Create a context
>             HttpContext context = new HttpContext();
>             context.setContextPath("/svt/*");
>             server.addContext(context);
>
>             // Create a servlet container -- i.e. handler
>             ServletHandler servlets = new ServletHandler();
>             context.addHandler(servlets);
>
>             // Map a servlet onto the container
>             // http://kiki:8787/svt/hello
>             servlets.addServlet("HelloServlet", "/hello/*",
> "HelloServlet");
>
>             // http://kiki:8787/svt/servlet/BeckyServlet
>             // where BekcyServlet is in the current directory
>             servlets.addServlet("Invoker", "/servlet/*",
>                 "org.mortbay.jetty.servlet.Invoker");
>         }
>
>
> thanks
> sunj
>
> ------------------------------------------------------------------------
> Sent from the Jetty Support
> <http://www.nabble.com/Jetty-Support-f61.html> forum at Nabble.com:
> invoker finds servlets only in the current directory
> <http://www.nabble.com/invoker-finds-servlets-only-in-the-current-directory-t643031.html#a1710274>
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support