On Mon, Jul 20, 2009 at 2:01 PM, [email protected] < [email protected]> wrote:
I was wondering what the best way of using clojure as a language for writing CGI web applications would be. I know that it can be used for web programming using java web servers, however I want to be able to develop application which can be simply uploaded to a server and `just work', like PHP. for which CGI is the only option I know of. Trying to use CGI sounds like a bad idea. It's always full of security issues <http://www.w3.org/Security/Faq/wwwsf4.html>. Why reinvent the wheel? App development using a database-backed web development environment like Xwiki gets rid of a lot of the issues that might give one pause programming traditional "java web servers," most of which is boilerplate cruft that should just be hidden away and encapsulated by a higher level interface.... which is exactly what Xwiki gives in terms of app-development. I don't think it would be *that* hard (compared to the heavy lifting already done) to support Clojure as a scripting language in java-based Xwiki<http://www.xwiki.org>. Xwiki already has strong support for scripting in Groovy and Velocity<http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting>. (Although this video is old and talks about Xwiki 1.0 (2.0 is nearing release) it's still a good intro to app-development in Xwiki: http://www.youtube.com/watch?v=xs3LuzwqemM ) http://code.xwiki.org/xwiki/bin/view/Snippets/DisplayFormatedCodeAttachmentsSnippet provides a suggestion for extending Xwiki with Clojure as a scripting language. Xwiki already has extensive java "plugins" that create a library for web app-development that you "script" in either Velocity<http://www.weather.gov/ost/SEC/AE/Site_Migration/Velocity%20User%20Guide.pdf>or Groovy <http://www.jcp.org/en/jsr/detail?id=241>. If Clojure has a JSR-223 implementation<http://www.theserverside.com/news/thread.tss?thread_id=26698>, you could easily leverage all the same Xwiki API's you normally access from Velocity or Groovy: VincentMassol | 2009/05/05 20:03 > Niels, no there's no plan but we can now support any language using macros so feel free to provide a clojure macro if you're interested. Shouldn't be too hard to do, especially if there's a JSR-223 implementation (in which case simply dropping the jar in WEB-INF/lib should be enough - you'd then use it using the script macro). I hope someone is inspired to try this out. I think it could be a surprisingly easy way to do web-programming in Lisp, by leveraging a flexible platform like Xwiki. Niels http://nielsmayer.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
