I found other information indicating that the jetty.xml should look like
this:

<Configure id="Server" class="org.eclipse.jetty.server.Server">
>   <Get name="handler">
>     <Call name="addHandler">
>       <Arg>
>         <New id="Rewrite"
> class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
>           <Set name="rewriteRequestURI">true</Set>
>           <Set name="rewritePathInfo">false</Set>
>           <Set name="originalPathAttribute">requestedPath</Set>
>
>           <Call name="addRule">
>             <Arg>
>               <New
> class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule">
>                 <Set name="pattern">/hp</Set>
>                 <Set name="location">/hp2</Set>
>               </New>
>             </Arg>
>           </Call>
>         </New>
>       </Arg>
>     </Call>


So the "addRule" should be under the RewriteHandler. When I do it this way
I get no errors. Unfortunately nothing is redirected either...

/Bengt



2016-11-09 13:33 GMT+01:00 Bengt Rodehav <[email protected]>:

> Sorry, I now see that it is included in "pax-jetty"..
>
> /Bengt
>
> 2016-11-09 13:31 GMT+01:00 Bengt Rodehav <[email protected]>:
>
>> It seems I'm pushing it. I've used Pax-Web in the past but only for
>> internal (not so complex) management applications. This time I'm using it
>> for a public web site which is somewhat more complex.
>>
>> It seems like I need to add the following to my feature:
>>
>>     <bundle 
>> start-level="30">mvn:org.eclipse.jetty/jetty-rewrite/9.2.19.v20160908</bundle>
>>
>>
>> ...since this bundle is not included in the "pax-jetty" feature. Maybe it
>> should be added there.
>>
>> However, I still get the same error. It seems like "addRule" is not
>> understood. Maybe it requires another bundle that I don't know of?
>>
>> /Bengt
>>
>>
>> 2016-11-09 13:23 GMT+01:00 'Achim Nierbeck' via OPS4J <
>> [email protected]>:
>>
>>> Hi Bengt,
>>>
>>> might very well be not possible ...
>>> ... we never had a request for this :-)
>>>
>>> regards, Achim
>>>
>>>
>>> 2016-11-09 12:21 GMT+01:00 Bengt Rodehav <[email protected]>:
>>>
>>>> I'm using Pax-Web in Karaf 4.0.7.
>>>>
>>>> To uphold url's from the previous system provider, I need to do some
>>>> redirection of old url's to the new url's.
>>>>
>>>> I tried to put the following in my jetty.xml:
>>>>
>>>>     <Call name="addRule">
>>>>>       <Arg>
>>>>>         <New class="org.eclipse.jetty.rewri
>>>>> te.handler.RedirectPatternRule">
>>>>>           <Set name="pattern">/hp/admin/index.php</Set>
>>>>>           <Set name="location">/hp/admin/index.html</Set>
>>>>>         </New>
>>>>>       </Arg>
>>>>>     </Call>
>>>>
>>>>
>>>> But I get:
>>>>
>>>> Caused by: java.lang.IllegalStateException: No Method: <Call
>>>>> name="addRule"><Arg>
>>>>>         <New class="org.eclipse.jetty.rewri
>>>>> te.handler.RedirectPatternRule"><Set 
>>>>> name="pattern">/hp/admin/index.php</Set><Set
>>>>> name="location">/hp/admin/index.html</Set></New>
>>>>>       </Arg></Call> on class org.ops4j.pax.web.service.jett
>>>>> y.internal.JettyServerHandlerCollection
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.call(XmlConfiguration.java:738)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.get(XmlConfiguration.java:662)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.configure(XmlConfiguration.java:420)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.configure(XmlConfiguration.java:298)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration.configure(XmlConfiguration.java:248)
>>>>>         ... 16 more
>>>>> Caused by: java.lang.NoSuchMethodException: addRule
>>>>>         at org.eclipse.jetty.util.TypeUtil.call(TypeUtil.java:537)
>>>>>         at org.eclipse.jetty.xml.XmlConfi
>>>>> guration$JettyXmlConfiguration.call(XmlConfiguration.java:730)
>>>>>         ... 21 more
>>>>
>>>>
>>>> Is it not possible to add Jetty redirection rules when using Pax-Web?
>>>>
>>>> /Bengt
>>>>
>>>> --
>>>> --
>>>> ------------------
>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "OPS4J" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> 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
>>>
>>> --
>>> --
>>> ------------------
>>> OPS4J - http://www.ops4j.org - [email protected]
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "OPS4J" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to