Freemarker itself doesn't care about things like sessions, HTTP requests and the like. It just receives a bunch of objects via the data-model, and then it can access those. So it's up to the web application framework what the templates can do. Modifying a session in an MVC template really smells though. That's the duty of the MVC Controller.
However, if you are using FreemarkerServlet, that creates a data-model that exposes the variables from the request, session and application scopes, and also provides Request, Session, Application variables to read the specific scopes. Though FreemarkerServlet is really just an adapter for legacy or JSP-only apps, otherwise I would avoid it.
Freemarker itself doesn't care about things like sessions, HTTP requests and the like. It just receives a bunch of objects via the data-model, and then it can access those. So it's up to the web application framework what the templates can do. Modifying a session in an MVC template really smells though. That's the duty of the MVC Controller.
However, if you are using
FreemarkerServlet
, that creates a data-model that exposes the variables from the request, session and application scopes, and also providesRequest
,Session
,Application
variables to read the specific scopes. ThoughFreemarkerServlet
is really just an adapter for legacy or JSP-only apps, otherwise I would avoid it.