:o 2016-11-09 14:39 GMT+01:00 Bengt Rodehav <[email protected]>:
> I actually got the configuration to work using my latest syntax. I haven't > fully understood how it works though. I don't get the results I want. Need > to investigate more. Have a feeling that Shiro is complicating things too. > > /Bengt > > 2016-11-09 14:26 GMT+01:00 'Achim Nierbeck' via OPS4J < > [email protected]>: > >> no idea ... >> just another idea, not sure if that works much better but maybe it will >> give better hints :) >> >> you can also try to register your handler as a service which will be >> picked up by Pax-Web [1] >> >> regards, Achim >> >> [1] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax >> -web-itest/pax-web-itest-container/pax-web-itest-container- >> jetty/src/test/java/org/ops4j/pax/web/itest/jetty/JettyHandl >> erServiceIntegrationTest.java#L86-L118 >> >> >> 2016-11-09 14:15 GMT+01:00 Bengt Rodehav <[email protected]>: >> >>> 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.rewri >>>> te.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.rewri >>>> te.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. >>> >> >> >> >> -- >> >> 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. > -- 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.
