On 8 December 2010 17:14, Marius Dumitru Florea < mariusdumitru.flo...@xwiki.com> wrote:
> On 12/08/2010 10:13 AM, Paul Harris wrote: > > On 8 December 2010 14:46, Paul Harris<harris...@gmail.com> wrote: > > > >> > >> > >> On 8 December 2010 14:14, Paul Harris<harris...@gmail.com> wrote: > >> > >>> Hi, > >>> > >>> I tried to follow the instructions here: > >>> http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs > >>> > >>> and the URLs look great, but I couldn't get the skins and logo to work. > >>> > >>> The problem is this part of the instructions: > >>> > >>> <servlet> > >>> <servlet-name>defaultSkins</servlet-name> > >>> <servlet-class>org.mortbay.jetty.servlet.Default</servlet-class> > >>> <init-param> > >>> <param-name>relativeResourceBase</param-name> > >>> <param-value>skins</param-value> > >>> </init-param> > >>> <load-on-startup>1</load-on-startup> > >>> </servlet> > >>> <servlet-mapping> > >>> <servlet-name>defaultSkins</servlet-name> > >>> <url-pattern>/skins/*</url-pattern> > >>> </servlet-mapping> > >>> > >>> This is totally wrong for me. I'm using xwiki + Jetty + lighttpd on > >>> Debian stable/testing. > >>> > >>> The correct entry into web.xml is to add: > >>> > >>> <servlet-mapping> > >>> <servlet-name>default</servlet-name> > >>> <url-pattern>/resources/*</url-pattern> > >>> </servlet-mapping> > >>> > >>> <servlet-mapping> > >>> <servlet-name>default</servlet-name> > >>> <url-pattern>/skins/*</url-pattern> > >>> </servlet-mapping> > >>> > >>> > >>> in addition to: > >>> <servlet-mapping> > >>> <servlet-name>action</servlet-name> > >>> <url-pattern>/*</url-pattern> > >>> </servlet-mapping> > >>> > >>> > >>> It would also help if someone wrote WHERE to put these things in the > >>> web.xml file. I guessed, and it appears to work. > >>> > >>> > >>> > >> Further to this, I discovered this fix does not work, as the > /resources/* > >> mapping seems to conflict with the *.gwtrpc mapping (mentioned in > another > >> email). > >> > >> When you Create A Link in the wysiwyg editor, it POSTs to: > >> /resources/js/xwiki/wysiwyg/xwe/HTMLConverter.gwtrpc > >> > >> how do I set up my web.xml file so that both the static resources, and > >> these apparently dynamic resource are able to both work? > >> > >> Please help, this is very frustrating. > >> > >> > > > > Ok, I have a solution that works for me. > > > > > HOWEVER, it will only work if ALL of the gwtrpc requests will be to urls > > such as > > domain.com/resources/blah/blah/file.gwtrpc > > In the default XE distribution the WYSIWYG editor is the only one making > GWT-RPC calls and they all go to *.gwtrpc URLs so you're safe. > > > > > This is the way I could have done it, if I had known where to put that > java > > code etc: > > > http://www.kuligowski.pl/java/rest-style-urls-and-url-mapping-for-static-content-apache-tomcat,5 > > > > The fundamental problem is due to the limited power of servlet mapping > > rules. > > ANY mapping to *.gwtrpc will not work if there is a /* mapping or a > > /resource/* mapping, as file extensions are always the lowest priority. > > > > > > So, instead of going the java-path, I used lighttpd since I am using it > > anyway. > > My new lighttpd rules are: > > $HTTP["host"] =~ "^www\.domain\.com$" { > > # ensure all requests for .gwtrpc files go through > > $HTTP["url"] =~ "\.gwtrpc$" { > > proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => 8080 > ))) > > } > > # otherwise, we can handle the static resources > > else $HTTP["url"] =~ "^/resources/" { > > alias.url += ( "/resources" => > > "/usr/share/jetty/webapps/root/resources" ) > > } > > # otherwise, we can handle the static resources > > else $HTTP["url"] =~ "^/skins/" { > > alias.url += ( "/skins" => > "/usr/share/jetty/webapps/root/skins" ) > > } > > # and here is the primary server > > else $HTTP["host"] =~ "^www\.domain\.com$" { > > proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => 8080 > ))) > > } > > } > > else $HTTP["host"] =~ "\.domain\.com$" { > > url.redirect = ( "^/(.*)" => "http://www.domain.com/$1" ) > > server.name = "www.domain.com" > > } > > > > else $HTTP["host"] =~ "domain\.com$" { > > url.redirect = ( "^/(.*)" => "http://www.domain.com/$1" ) > > server.name = "www.domain.com" > > } > > > > > > > > so lighttpd will serve static content from resources and skins, EXCEPT if > it > > ends with .gwtrpc > > > > THEN in web.xml: I change the gwtrpc mapping to: > > <servlet-mapping> > > <servlet-name>gwtrpc</servlet-name> > > <url-pattern>/resources/*</url-pattern> > > <url-pattern>/skins/*</url-pattern> > > </servlet-mapping> > > because we know that anything that makes it past lighttpd in the > resources > > or skins folder MUST be a gwtrpc file. > > > > AND then I do not need the skins/resources mappings (that I mentioned > above > > in prev email), all I need to add is: > > <servlet-mapping> > > <servlet-name>action</servlet-name> > > <url-pattern>/*</url-pattern> > > </servlet-mapping> > > > > > > yay. > > > please put this up on the wiki for ShortUrls, it might save someone like > me > > quite a few hours. > > Note that xwiki.org is an open wiki so you can register and contribute. > > Thanks, > Marius > > I've made the changes to http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs can someone please check it over for me? thanks Paul _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users