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

com.khubla.pragmatach.plugin.thymeleaf.ThymeleafController Maven / Gradle / Ivy

package com.khubla.pragmatach.plugin.thymeleaf;

import org.thymeleaf.templateresolver.ITemplateResolver;

import com.khubla.pragmatach.framework.api.PragmatachException;
import com.khubla.pragmatach.framework.api.Response;
import com.khubla.pragmatach.framework.controller.impl.FormPostBeanBoundController;

/**
 * @author tome
 */
public class ThymeleafController extends FormPostBeanBoundController {
   /**
    * ctor
    */
   public ThymeleafController() {
   }

   /**
    * render
    */
   public Response render() throws PragmatachException {
      try {
         final ITemplateResolver templateResolver = new PragmatachTemplateResolver(getRequest().getServletContext());
         return new ThymeleafResponse(getCacheHeaders(), getTemplateName(), getTemplateContext(), templateResolver);
      } catch (final Exception e) {
         throw new PragmatachException("Exception in render", e);
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy