You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Frizz <fr...@googlemail.com> on 2014/12/01 12:09:42 UTC
Karaf 3.0.2: Serving static HTML with Karaf (Jetty)
Since Karaf has Jetty included it shouldn't be too hard to make it serve
static HTML pages. Unfortunately I haven't figured out how to do it.
Does someone have a config example or something like?
I tried adding this to my jetty.xml - but it didn't work (-> HTTP ERROR:
404)
<Get name="handler">
<Call name="addHandler">
<Arg>
<New
class="org.eclipse.jetty.servlet.ServletContextHandler">
<Set name="contextPath">/app</Set>
<Set name="resourceBase">/home/frizz/html-example/
</Set>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Arg>
</Call>
</Get>
cheers,
Frizz
Re: Karaf 3.0.2: Serving static HTML with Karaf (Jetty)
Posted by Achim Nierbeck <bc...@googlemail.com>.
It should, we need to upgrade to the latest Pax Web version :-)
regards, Achim
2014-12-01 17:33 GMT+01:00 Frizz <fr...@googlemail.com>:
> Thanks for your reply.
>
> So in Karaf 3.0.3 it's working again?
>
> On Mon, Dec 1, 2014 at 12:40 PM, Achim Nierbeck <bc...@googlemail.com>
> wrote:
>
>> Hi,
>>
>> it's a known bug in Pax Web [1], and already fixed there :-)
>> Will be available with next release of Pax Web and Karaf.
>>
>> regards, Achim
>>
>> [1] - https://ops4j1.jira.com/browse/PAXWEB-738
>>
>> 2014-12-01 12:09 GMT+01:00 Frizz <fr...@googlemail.com>:
>>
>>> Since Karaf has Jetty included it shouldn't be too hard to make it serve
>>> static HTML pages. Unfortunately I haven't figured out how to do it.
>>>
>>> Does someone have a config example or something like?
>>>
>>> I tried adding this to my jetty.xml - but it didn't work (-> HTTP ERROR:
>>> 404)
>>>
>>> <Get name="handler">
>>> <Call name="addHandler">
>>> <Arg>
>>> <New
>>> class="org.eclipse.jetty.servlet.ServletContextHandler">
>>> <Set name="contextPath">/app</Set>
>>> <Set name="resourceBase">/home/frizz/html-example/
>>> </Set>
>>> <Call name="addServlet">
>>>
>>> <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
>>> <Arg>/</Arg>
>>> </Call>
>>> </New>
>>> </Arg>
>>> </Call>
>>> </Get>
>>>
>>> cheers,
>>> Frizz
>>>
>>
>>
>>
>> --
>>
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
>> & Project Lead
>> blog <http://notizblog.nierbeck.de/>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>
>> Software Architect / Project Manager / Scrum Master
>>
>>
>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Karaf 3.0.2: Serving static HTML with Karaf (Jetty)
Posted by Frizz <fr...@googlemail.com>.
Thanks for your reply.
So in Karaf 3.0.3 it's working again?
On Mon, Dec 1, 2014 at 12:40 PM, Achim Nierbeck <bc...@googlemail.com>
wrote:
> Hi,
>
> it's a known bug in Pax Web [1], and already fixed there :-)
> Will be available with next release of Pax Web and Karaf.
>
> regards, Achim
>
> [1] - https://ops4j1.jira.com/browse/PAXWEB-738
>
> 2014-12-01 12:09 GMT+01:00 Frizz <fr...@googlemail.com>:
>
>> Since Karaf has Jetty included it shouldn't be too hard to make it serve
>> static HTML pages. Unfortunately I haven't figured out how to do it.
>>
>> Does someone have a config example or something like?
>>
>> I tried adding this to my jetty.xml - but it didn't work (-> HTTP ERROR:
>> 404)
>>
>> <Get name="handler">
>> <Call name="addHandler">
>> <Arg>
>> <New
>> class="org.eclipse.jetty.servlet.ServletContextHandler">
>> <Set name="contextPath">/app</Set>
>> <Set name="resourceBase">/home/frizz/html-example/
>> </Set>
>> <Call name="addServlet">
>>
>> <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
>> <Arg>/</Arg>
>> </Call>
>> </New>
>> </Arg>
>> </Call>
>> </Get>
>>
>> cheers,
>> Frizz
>>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
Re: Karaf 3.0.2: Serving static HTML with Karaf (Jetty)
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,
it's a known bug in Pax Web [1], and already fixed there :-)
Will be available with next release of Pax Web and Karaf.
regards, Achim
[1] - https://ops4j1.jira.com/browse/PAXWEB-738
2014-12-01 12:09 GMT+01:00 Frizz <fr...@googlemail.com>:
> Since Karaf has Jetty included it shouldn't be too hard to make it serve
> static HTML pages. Unfortunately I haven't figured out how to do it.
>
> Does someone have a config example or something like?
>
> I tried adding this to my jetty.xml - but it didn't work (-> HTTP ERROR:
> 404)
>
> <Get name="handler">
> <Call name="addHandler">
> <Arg>
> <New
> class="org.eclipse.jetty.servlet.ServletContextHandler">
> <Set name="contextPath">/app</Set>
> <Set name="resourceBase">/home/frizz/html-example/
> </Set>
> <Call name="addServlet">
> <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
> <Arg>/</Arg>
> </Call>
> </New>
> </Arg>
> </Call>
> </Get>
>
> cheers,
> Frizz
>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master