All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.igumnov.common.webserver.ControllerContext Maven / Gradle / Ivy

Go to download

Common Java library - Simple, small, stable and fast library with Simplified Enterprise Server (Dependency Injection, WebServer and ORM Frameworks)

There is a newer version: 10.8
Show newest version
package com.igumnov.common.webserver;

import org.thymeleaf.context.IContext;
import org.thymeleaf.context.IWebContext;
import org.thymeleaf.context.VariablesMap;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Locale;
import java.util.Map;

public class ControllerContext implements IWebContext {

    private Map model;
    private ServletContext servletContext;
    public ControllerContext(Map m, ServletContext sc) {

        model = m;
        servletContext =sc;
    }
    @Override
    public VariablesMap getVariables() {
        VariablesMap ret = new VariablesMap<>();
        ret.putAll(model);
        return ret;
    }

    @Override
    public Locale getLocale() {
        return Locale.ENGLISH;
    }

    @Override
    public void addContextExecutionInfo(String templateName) {

    }

    @Override
    public HttpServletRequest getHttpServletRequest() {
        return null;
    }

    @Override
    public HttpServletResponse getHttpServletResponse() {
        return null;
    }

    @Override
    public HttpSession getHttpSession() {
        return null;
    }

    @Override
    public ServletContext getServletContext() {
        return servletContext;
    }

    @Override
    public VariablesMap getRequestParameters() {
        return null;
    }

    @Override
    public VariablesMap getRequestAttributes() {
        return null;
    }

    @Override
    public VariablesMap getSessionAttributes() {
        return null;
    }

    @Override
    public VariablesMap getApplicationAttributes() {
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy