How to set up web.xml (e.g. with Leiningen)?

I’ve spent several years happily building webapps in Clojure, but now I find myself requiring an authentication library that dictates the use of xml. In particular, it expects me to have a web.xml configuration.

I use Leiningen and deploy to a shared Wildfly app server. How should I set up a web.xml for my application?

Does it need to change or is it fixed? Do you need to create a WAR file for distribution?
Gradle has a lot of handy tasks for that.

I’m looking at ways to implement CAS, which expects most configuration to be done in web.xml. Apparently I need to add a bunch of stuff to whatever web.xml is being produced by lein immutant war. Until now I wasn’t really aware of web.xml at all, and hate having to depend on xml as much as having to deal with Java.

I use Leiningen so was hoping a solution existed there without having to learn Gradle.

Ah – I found the documentation for how to set my web.xml in my final uberwar:
lein help immutant deployment

These tell how to produce that final web.xml. However, it doesn’t look like I’ll be able to use that solution to actively test in my REPL workflow. Am I thinking about this wrong? Surely there’s some way I can get the web.xml configuration functionality from repl session, before I produce the uberwar? (I’m showing my ignorance of java deployment and web.xml here)

I don’t know about Immutant, but those are just filters added, so when it’s running, your REPL will be alive in the process receiving the requests.

BTW, what is CAS? Club Alpin Suisse? :wink:

“Central Authentication Service”, used by many universities (and probably others). Our university is doing a big upgrade that requires me to rewrite the CAS middleware that we’ve been using for the past several years.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.