Closed yogthos closed 9 years ago
Ring hasn't changed. The :servlet-context
and :context
keys are two different things.
The :servlet-context
key is used for compatibility with legacy servlet systems, and contains a ServletContext
object. The :context
key is used in conjunction with the :path-info
key, and is used to divide the :uri
key into a prefix and suffix.
Ah ok makes sense, I wasn't sure which context this was referring to, as originally Ring used :context
for both the context macro and the servlet context.
Actually, it didn't, but I don't blame you for thinking that. It's actually Lein-Ring that sneakily sets the :context
and :path-info
keys when you compile a war or uberwar (see the generate-handler function).
That explains the why the :context
has the servlet context by default then. If I recall correctly, that behavior interfered with the context macro though did it not?
Nope. The context macro can deal with a pre-existing :context
key, otherwise you wouldn't be able to nest it.
So the servlet context is treated as the initial context then if present.
Right.
Great thanks for walking me through it. :)
The base-url in the middleware is using
:context
, should it be changed to:servlet-context
since it was changed in Ring recently?