Hi everyone,

I have been banging my head on the walls for a few hours now and really cannot
figure out the proper way to serve static files in a Compojure application
deployed on Tomcat or Glassfish...

Feeling pretty dumb in fact...

I tried to configure the default servlet to catch up requests but I feel
that I cannot escape the Ring routes so this never worked.

The static files reside in the folder stylesheets at the very top of the
application folder. The application path is IDEMDossierPatient.

The HTML link references stylesheets/... 

I get the following stack trace:

SEVERE: Allocate exception for servlet IDEMDossierPatient
java.lang.Exception: Directory does not exist: stylesheets
    at ring.middleware.file$ensure_dir.invoke(file.clj:13)
    at ring.middleware.file$wrap_file.doInvoke(file.clj:23)
    at clojure.lang.RestFn.invoke(RestFn.java:426)
    at ring.middleware.static$wrap_static.invoke(static.clj:13)
    at 
idem.mr.clinic.webaccess.medicalrecord$eval1206.invoke(medicalrecord.clj:52)
...

The routes are the following (after several attempts with the file wrapper):

(defroutes app-routes
   (GET "/patient" [patient-id]
     (render-page "Dossier médical") (render-page (load-patient-mr patient-id)))
  (GET "/req" req (str req))
  (GET "/file" [] (doto (java.io.File. ".") (.getAbsolutePath)))
  (GET "/" [] (render-page "Saisie du # de patient" patient-form)) 
  (route/not-found "Page inconnue")
)

(wrap! app-routes :stacktrace)
(wrap! app-routes (:static "stylesheets" ["stylesheets"]))

Any ideas where I am going with this aside from a dead end ?
Is there another way to specify the folder for static file ?
Should I specify an absolute path (ugly but given where I am right
now I would not care...) ?
Should I move the folder elsewhere ?

Blblblblblblbl...

Thank you,

Luc 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to