Question


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import clojure.lang.RT;
import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;

public class Clojure4Vaadin extends AbstractApplicationServlet {

  @Override
  protected Class<? extends Application> getApplicationClass()throws ClassNotFoundException {
      return Application.class;
  }
  .... Some code .....
}

How to write this in Clojure?

I'm trying to write the vaadin srvlet class in clojure:

http://dev.vaadin.com/wiki/Articles/ClojureScripting

Was it helpful?

Solution

I think what you're looking for is the following:

(def Clojure4Vaadin 
  (proxy [com.vaadin.terminal.gwt.server.AbstractApplicationServlet] []
    (getApplicationClass [] com.vaadin.Application)))

Have a look at the documentation of proxy.

OTHER TIPS

The code you have given above is used to serve a webapp written in clojure via the vaadin framework. This code is meant to be run as Java Servlet as it is and the webapp logic would be in the clojure code (test.tlp), you would have to compile the servlet and package it with the clojure script in the webapp root directory.

Regards, Shanmu

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top