Search code examples
google-caja

Set up a production ready caja server


I found this post:

http://markmail.org/thread/4g6j2vgq3fpcpjr5#query:+page:1+mid:7rcagkd6of44x3fk+state:results

but there is no "maven" target in the current caja ant build file. I also spent a couple of hours looking through the rather sparse caja docs, and reading files in the checkout, and haven't seen any clear indication of how to get this running in a production ready manner. There is a dev server target in the ant build, but running ant to start this in production is not very attractive.

I cannot use the google hosted caja server (project requirements against outgoing 3rd party requests from the UI) so I would need to set up my own server if I use caja. My desire is to use caja to ensure that the embeded fragments I write don't ever run amok with the hosted service into which they are being embeded (or each other). This particularly applies to things like conflicts with html id conflicts, jquery versions or css style conflicts (the later of which has already bitten us).

I want to be able to install this as a war in a container, or as a servlet within my app. I've also wondered if the cajoling could be done as a ServletFilter.

Is there a way to build a war, or some documentation of how to achieve this via servlet or filter?


Solution

  • Thank you very much for your interest in using Caja.

    You are correct about our build script, but there's an easy way to get to what you need. If you run ant AllTests from a Caja source tree, you will get an ant-war/ directory. It is not a minimal, clean production release, since it serves up among other things the Caja Playground and a bunch of tests. But it does give you a running Caja server, and you can deploy this in your favorite Java webapp container.

    If you have problems with this procedure, please let us know. Also please file a bug with our product at:

    https://code.google.com/p/google-caja/issues/entry

    to remind us to pay attention to this the next time we go digging around our build.xml.

    Ihab Awad