Salut,
Edward Chou wrote:
> I am using the latest version, 1.9.10.
>
> Jeanfrancois Arcand wrote:
>> Salut,
>>
>> Edward Chou wrote:
>>> Hi,
>>>
>>> I am wondering if the following is possible:
>>>
>>> GrizzlyWebServer webServer = new GrizzlyWebServer(9999);
>>> ServletAdapter adapter1 = createAdapter("/atom1");
>>>
>>> webServer.addGrizzlyAdapter(adapter1, new String[] { "/atom1" });
>>> webServer.start();
>>>
>>> < .. do something else ... >
>>> ServletAdapter adapter2 = createAdapter("/atom2");
>>> webServer.addGrizzlyAdapter(adapter2, new String[] { "/atom2" });
>>
>> Yes, it should work:\. Take a look at:
>>
>> https://grizzly.dev.java.net/nonav/xref-test/com/sun/grizzly/http/GrizzlyWebServerTest.html
>>
I've just added a unit test and for me it pass. Can you share your code?
> +
> + public void testAddGrizzlyAdapterBeforeAndAfterStart() throws IOException {
> + System.out.println("testAddGrizzlyAdapterBeforeAndAfterStart");
> + try {
> + gws = new GrizzlyWebServer(PORT);
> + String[] aliases = new String[]{"/1", "/2", "/3"};
> + for (String alias : aliases) {
> + addAdapter(alias);
> + }
> + gws.start();
> + String alias = "/4";
> + addAdapter(alias);
> +
> + HttpURLConnection conn = getConnection(alias);
> + assertEquals(HttpServletResponse.SC_OK,
> + getResponseCodeFromAlias(conn));
> + assertEquals(alias, readResponse(conn));
> + } finally {
> + stopGrizzlyWebServer();
> + }
> + }
> +
> +
> +
Thanks
-- Jeanfrancois
>>
>>
>>>
>>>
>>> Basically, I want to deploy a second ServletAdapter after the
>>> GrizzlyWebServer has already been started. Currently, the second
>>> servlet is not activated, but first servlet is. Any help is
>>> appreciated.
>>
>> Hum...let me try it then. Which version are you using?
>>
>> Thanks
>>
>> -- Jeanfrancois
>>
>>
>>>
>>> Edward
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>