문제


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

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top