Quantcast

How to set Wicket with embedded Jetty?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to set Wicket with embedded Jetty?

Surapol Pairojtanachai
Please guide me on how to set Wicket to run with embedded Jetty. I run
the code below and keep getting "java.lang.IllegalStateException: filter
path was not configured".

Thanks in Advance,
Surapol Pairojtanachai

        Server server = new Server();
        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setHost("localhost");
        connector.setPort(8080);
        server.setConnectors(new Connector[] { connector });
        Context root = new Context(server, "/", Context.SESSIONS);
              ServletHolder serverHolder = new ServletHolder(new
DefaultServlet());
        root.addServlet(serverHolder, "/*");
        FilterHolder filterHolder = new FilterHolder(WicketFilter.class);

filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
MyWebServer.class.getName());
        root.addFilter(filterHolder, "/*", Handler.DEFAULT);
        server.start();
        server.join();



ubuntu 10.10 amd64
JDK 1.6.0.23 amd64
Jetty 6.1.26



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

James Carman
Why don't you try creating a quickstart
(http://wicket.apache.org/start/quickstart.html) and just copy the
code from the Start class that's provided for you there?


On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
<[hidden email]> wrote:

> Please guide me on how to set Wicket to run with embedded Jetty. I run
> the code below and keep getting "java.lang.IllegalStateException: filter
> path was not configured".
>
> Thanks in Advance,
> Surapol Pairojtanachai
>
>       Server server = new Server();
>       SelectChannelConnector connector = new SelectChannelConnector();
>       connector.setHost("localhost");
>       connector.setPort(8080);
>       server.setConnectors(new Connector[] { connector });
>       Context root = new Context(server, "/", Context.SESSIONS);
>             ServletHolder serverHolder = new ServletHolder(new
> DefaultServlet());
>       root.addServlet(serverHolder, "/*");
>       FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>
> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
> MyWebServer.class.getName());
>       root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>       server.start();
>       server.join();
>
>
>
> ubuntu 10.10 amd64
> JDK 1.6.0.23 amd64
> Jetty 6.1.26
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

Surapol Pairojtanachai
It doesn't create wicket project with embedded jetty. By embedded jetty,
I mean no web.xml file. Is this possible?

Regards,
Surapol

On 02/07/2011 11:28 AM, James Carman wrote:

> Why don't you try creating a quickstart
> (http://wicket.apache.org/start/quickstart.html) and just copy the
> code from the Start class that's provided for you there?
>
>
> On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
> <[hidden email]>  wrote:
>> Please guide me on how to set Wicket to run with embedded Jetty. I run
>> the code below and keep getting "java.lang.IllegalStateException: filter
>> path was not configured".
>>
>> Thanks in Advance,
>> Surapol Pairojtanachai
>>
>>        Server server = new Server();
>>        SelectChannelConnector connector = new SelectChannelConnector();
>>        connector.setHost("localhost");
>>        connector.setPort(8080);
>>        server.setConnectors(new Connector[] { connector });
>>        Context root = new Context(server, "/", Context.SESSIONS);
>>              ServletHolder serverHolder = new ServletHolder(new
>> DefaultServlet());
>>        root.addServlet(serverHolder, "/*");
>>        FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>>
>> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
>> MyWebServer.class.getName());
>>        root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>>        server.start();
>>        server.join();
>>
>>
>>
>> ubuntu 10.10 amd64
>> JDK 1.6.0.23 amd64
>> Jetty 6.1.26
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

James Carman
This is not a Wicket question, then.  I'd try the Jetty mailing lists.

On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
<[hidden email]> wrote:

> It doesn't create wicket project with embedded jetty. By embedded jetty, I
> mean no web.xml file. Is this possible?
>
> Regards,
> Surapol
>
> On 02/07/2011 11:28 AM, James Carman wrote:
>>
>> Why don't you try creating a quickstart
>> (http://wicket.apache.org/start/quickstart.html) and just copy the
>> code from the Start class that's provided for you there?
>>
>>
>> On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
>> <[hidden email]>  wrote:
>>>
>>> Please guide me on how to set Wicket to run with embedded Jetty. I run
>>> the code below and keep getting "java.lang.IllegalStateException: filter
>>> path was not configured".
>>>
>>> Thanks in Advance,
>>> Surapol Pairojtanachai
>>>
>>>       Server server = new Server();
>>>       SelectChannelConnector connector = new SelectChannelConnector();
>>>       connector.setHost("localhost");
>>>       connector.setPort(8080);
>>>       server.setConnectors(new Connector[] { connector });
>>>       Context root = new Context(server, "/", Context.SESSIONS);
>>>             ServletHolder serverHolder = new ServletHolder(new
>>> DefaultServlet());
>>>       root.addServlet(serverHolder, "/*");
>>>       FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>>>
>>>
>>> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
>>> MyWebServer.class.getName());
>>>       root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>>>       server.start();
>>>       server.join();
>>>
>>>
>>>
>>> ubuntu 10.10 amd64
>>> JDK 1.6.0.23 amd64
>>> Jetty 6.1.26
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

Surapol Pairojtanachai
I can easily create embedded jetty project (java web project without
WEB-INF and web.xml), hence a very modular web server for many purposes.
No need to have configuration for a simple/quick fix and small web
server. Only embedded jetty with Wicket that I cannot do. It seems
Wicket is really fixated to web.xml. Can this character be bypassed?

Thanks,
Surapol

On 02/07/2011 11:56 AM, James Carman wrote:

> This is not a Wicket question, then.  I'd try the Jetty mailing lists.
>
> On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
> <[hidden email]>  wrote:
>> It doesn't create wicket project with embedded jetty. By embedded jetty, I
>> mean no web.xml file. Is this possible?
>>
>> Regards,
>> Surapol
>>
>> On 02/07/2011 11:28 AM, James Carman wrote:
>>> Why don't you try creating a quickstart
>>> (http://wicket.apache.org/start/quickstart.html) and just copy the
>>> code from the Start class that's provided for you there?
>>>
>>>
>>> On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
>>> <[hidden email]>    wrote:
>>>> Please guide me on how to set Wicket to run with embedded Jetty. I run
>>>> the code below and keep getting "java.lang.IllegalStateException: filter
>>>> path was not configured".
>>>>
>>>> Thanks in Advance,
>>>> Surapol Pairojtanachai
>>>>
>>>>        Server server = new Server();
>>>>        SelectChannelConnector connector = new SelectChannelConnector();
>>>>        connector.setHost("localhost");
>>>>        connector.setPort(8080);
>>>>        server.setConnectors(new Connector[] { connector });
>>>>        Context root = new Context(server, "/", Context.SESSIONS);
>>>>              ServletHolder serverHolder = new ServletHolder(new
>>>> DefaultServlet());
>>>>        root.addServlet(serverHolder, "/*");
>>>>        FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>>>>
>>>>
>>>> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
>>>> MyWebServer.class.getName());
>>>>        root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>>>>        server.start();
>>>>        server.join();
>>>>
>>>>
>>>>
>>>> ubuntu 10.10 amd64
>>>> JDK 1.6.0.23 amd64
>>>> Jetty 6.1.26
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

Attila Király
Hi Surapol,

Try adding this before registering the filter:

filterHolder.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");

It seems wicket is not parsing the web.xml if that init parameter is
present.

Attila

2011/2/7 Surapol Pairojtanachai <[hidden email]>

> I can easily create embedded jetty project (java web project without
> WEB-INF and web.xml), hence a very modular web server for many purposes. No
> need to have configuration for a simple/quick fix and small web server. Only
> embedded jetty with Wicket that I cannot do. It seems Wicket is really
> fixated to web.xml. Can this character be bypassed?
>
> Thanks,
> Surapol
>
> On 02/07/2011 11:56 AM, James Carman wrote:
>
>> This is not a Wicket question, then.  I'd try the Jetty mailing lists.
>>
>> On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
>> <[hidden email]>  wrote:
>>
>>> It doesn't create wicket project with embedded jetty. By embedded jetty,
>>> I
>>> mean no web.xml file. Is this possible?
>>>
>>> Regards,
>>> Surapol
>>>
>>> On 02/07/2011 11:28 AM, James Carman wrote:
>>>
>>>> Why don't you try creating a quickstart
>>>> (http://wicket.apache.org/start/quickstart.html) and just copy the
>>>> code from the Start class that's provided for you there?
>>>>
>>>>
>>>> On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
>>>> <[hidden email]>    wrote:
>>>>
>>>>> Please guide me on how to set Wicket to run with embedded Jetty. I run
>>>>> the code below and keep getting "java.lang.IllegalStateException:
>>>>> filter
>>>>> path was not configured".
>>>>>
>>>>> Thanks in Advance,
>>>>> Surapol Pairojtanachai
>>>>>
>>>>>       Server server = new Server();
>>>>>       SelectChannelConnector connector = new SelectChannelConnector();
>>>>>       connector.setHost("localhost");
>>>>>       connector.setPort(8080);
>>>>>       server.setConnectors(new Connector[] { connector });
>>>>>       Context root = new Context(server, "/", Context.SESSIONS);
>>>>>             ServletHolder serverHolder = new ServletHolder(new
>>>>> DefaultServlet());
>>>>>       root.addServlet(serverHolder, "/*");
>>>>>       FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>>>>>
>>>>>
>>>>>
>>>>> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
>>>>> MyWebServer.class.getName());
>>>>>       root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>>>>>       server.start();
>>>>>       server.join();
>>>>>
>>>>>
>>>>>
>>>>> ubuntu 10.10 amd64
>>>>> JDK 1.6.0.23 amd64
>>>>> Jetty 6.1.26
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>  ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
"I would rather write programs to write programs than write programs."
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to set Wicket with embedded Jetty?

Surapol Pairojtanachai
Yes, it is working now. Thank you very much.

Surapol


On 02/07/2011 03:17 PM, Attila Király wrote:

> Hi Surapol,
>
> Try adding this before registering the filter:
>
> filterHolder.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
>
> It seems wicket is not parsing the web.xml if that init parameter is
> present.
>
> Attila
>
> 2011/2/7 Surapol Pairojtanachai<[hidden email]>
>
>> I can easily create embedded jetty project (java web project without
>> WEB-INF and web.xml), hence a very modular web server for many purposes. No
>> need to have configuration for a simple/quick fix and small web server. Only
>> embedded jetty with Wicket that I cannot do. It seems Wicket is really
>> fixated to web.xml. Can this character be bypassed?
>>
>> Thanks,
>> Surapol
>>
>> On 02/07/2011 11:56 AM, James Carman wrote:
>>
>>> This is not a Wicket question, then.  I'd try the Jetty mailing lists.
>>>
>>> On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
>>> <[hidden email]>   wrote:
>>>
>>>> It doesn't create wicket project with embedded jetty. By embedded jetty,
>>>> I
>>>> mean no web.xml file. Is this possible?
>>>>
>>>> Regards,
>>>> Surapol
>>>>
>>>> On 02/07/2011 11:28 AM, James Carman wrote:
>>>>
>>>>> Why don't you try creating a quickstart
>>>>> (http://wicket.apache.org/start/quickstart.html) and just copy the
>>>>> code from the Start class that's provided for you there?
>>>>>
>>>>>
>>>>> On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
>>>>> <[hidden email]>     wrote:
>>>>>
>>>>>> Please guide me on how to set Wicket to run with embedded Jetty. I run
>>>>>> the code below and keep getting "java.lang.IllegalStateException:
>>>>>> filter
>>>>>> path was not configured".
>>>>>>
>>>>>> Thanks in Advance,
>>>>>> Surapol Pairojtanachai
>>>>>>
>>>>>>        Server server = new Server();
>>>>>>        SelectChannelConnector connector = new SelectChannelConnector();
>>>>>>        connector.setHost("localhost");
>>>>>>        connector.setPort(8080);
>>>>>>        server.setConnectors(new Connector[] { connector });
>>>>>>        Context root = new Context(server, "/", Context.SESSIONS);
>>>>>>              ServletHolder serverHolder = new ServletHolder(new
>>>>>> DefaultServlet());
>>>>>>        root.addServlet(serverHolder, "/*");
>>>>>>        FilterHolder filterHolder = new FilterHolder(WicketFilter.class);
>>>>>>
>>>>>>
>>>>>>
>>>>>> filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
>>>>>> MyWebServer.class.getName());
>>>>>>        root.addFilter(filterHolder, "/*", Handler.DEFAULT);
>>>>>>        server.start();
>>>>>>        server.join();
>>>>>>
>>>>>>
>>>>>>
>>>>>> ubuntu 10.10 amd64
>>>>>> JDK 1.6.0.23 amd64
>>>>>> Jetty 6.1.26
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [hidden email]
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>>   ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>   ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...