First thing that we need to do to get things started is to create a servlet clojure file which will load the Vaadin application.
(ns example.vaadin-servlet (:gen-class :extends com.vaadin.terminal.gwt.server.AbstractApplicationServlet :name example.VaadinServlet)) (defn ^Class -getApplicationClass [this] example.VApp) (defn ^hms.appstore.ui.main.VApp -getNewApplication [this request] (example.VApp.))
This will be the servlet that you will add into the web.xml keep in mind the java class name will be example.VaadinServlet.
Next is to create the Vaadin Application which would look something this.
(ns example.vapp (:gen-class :extends com.vaadin.Application :name example.VApp :init cjinit)) (defn -cjinit [] [[] (ref {})]) (defmacro window [name caption container & body] `(let [caption# ~caption container# ~container ~name (com.vaadin.ui.Window. caption# container#) ~(symbol (str name "-" "container")) container#] ~@body)) (defn -init [this] (println "=== Initiating Vaadin Application ==") (let [comps (transient {})] (window w "Clojure Vaadin Application" (com.vaadin.ui.VerticalLayout) (.setSizeUndefined w-container) (.setMainWindow this w) (let [layout (com.vaadin.ui.VerticalLayout.)]) (.addComponent w-container layout) (.addComponent layout (com.vaadin.ui.Label. "Test Message")))))
Thats all. I have used a macro for the window can do without that as well.
"I have read so many articles or reviews however this blog post is genuinely a pleasant article, keep it up. .
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Thanks for sharing in this blog...its very useful for us...keep on going…
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
Bitsum Process Lasso 11 offers a pro unique process optimization technology called ProBalance. Process Lasso will improve your PC's responsiveness.Process Lasso Pro 11.1.0.34 + Full Crack Download
ReplyDelete