users@grizzly.java.net

Re: How does mapping work?

From: Sebastien Dionne <survivant00_at_gmail.com>
Date: Tue, 25 May 2010 22:45:52 -0400

you could use Deployer to do that for you, if you can package your
application in a .war.



2010/5/25 Andrea Gualano <andrea.gualano_at_imavis.com>

> Hello,
> I am confused by how the mapping of GrizzlyAdapters works.
>
> If I configure a web server like this:
>
> GrizzlyWebServer ws = new GrizzlyWebServer();
>
> ServletAdapter sa1 = new ServletAdapter();
> sa1.setServletInstance(new HelloWorldServlet());
> sa1.setContextPath("/hello");
> sa1.setServletPath("/world");
> ws.addGrizzlyAdapter(sa1, new String[]{"/hello/world/*"});
>
> ServletAdapter sa2 = new ServletAdapter();
> sa2.setServletInstance(new HelloMarsServlet());
> sa2.setContextPath("/hello");
> sa2.setServletPath("/mars");
> ws.addGrizzlyAdapter(sa2, new String[]{"/hello/mars/*"});
>
> ws.start();
>
> Requests to the URLs /hello/world, /hello/world/moon, and so on are served
> by HelloWorldServlet, as expected; requests to /hello/mars and
> /hello/mars/phobos are also served by HelloMarsServlet as expected.
> Request to / and /hi generate a 404 error, which is also expected.
>
> However, a request for /hello/mercury is served by HelloWorldServlet or
> HelloMarsServlet (randomly). Is this the expected behavior?
> What should I do to only serve /hello/world/* and /hello/mars/* ?
> Add an adapter for /? o for /hello/*?
>
> All tests done on version 1.9.18-k.
>
> Best regards,
> Andrea
>
> --
> Andrea Gualano
> ImaVis S.r.l.
> email: andrea.gualano_at_imavis.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>


-- 
-------------
A+
Sébastien.
Vous pouvez me suivre sur Twitter / You can follow me on Twitter :
http://twitter.com/survivant