You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2019/04/09 22:09:35 UTC

[portals-pluto] branch master updated: PLUTO-773 Develop JSP and Thymeleaf MVCBean demo portlets

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git


The following commit(s) were added to refs/heads/master by this push:
     new 47b3737  PLUTO-773 Develop JSP and Thymeleaf MVCBean demo portlets
47b3737 is described below

commit 47b3737af49be3b6b32cffb4f02b912cfea07b4d
Author: Neil Griffin <ne...@gmail.com>
AuthorDate: Tue Apr 9 17:03:48 2019 -0400

    PLUTO-773 Develop JSP and Thymeleaf MVCBean demo portlets
---
 demo/applicant-mvcbean-cdi-jsp-portlet/pom.xml     | 112 +++++++
 .../jsp/controller/ApplicantActionController.java  | 106 +++++++
 .../jsp/controller/ApplicantRenderController.java  | 115 ++++++++
 .../controller/ApplicantResourceController.java    | 191 ++++++++++++
 .../cdi/jsp/controller/AttachmentManager.java      |  65 ++++
 .../cdi/jsp/controller/HelpRenderController.java   |  36 +++
 .../controller/PreferencesActionController.java    | 134 +++++++++
 .../controller/PreferencesRenderController.java    |  58 ++++
 .../jsp/controller/TermsResourceController.java    |  80 +++++
 .../cdi/jsp/convert/DateParamConverter.java        |  54 ++++
 .../jsp/convert/DateParamConverterProvider.java    |  52 ++++
 .../applicant/mvcbean/cdi/jsp/dto/Applicant.java   | 177 +++++++++++
 .../applicant/mvcbean/cdi/jsp/dto/Attachment.java  |  47 +++
 .../applicant/mvcbean/cdi/jsp/dto/City.java        |  61 ++++
 .../applicant/mvcbean/cdi/jsp/dto/Preferences.java |  44 +++
 .../applicant/mvcbean/cdi/jsp/dto/Province.java    |  49 +++
 .../applicant/mvcbean/cdi/jsp/el/Converter.java    |  86 ++++++
 .../applicant/mvcbean/cdi/jsp/el/Expression.java   |  48 +++
 .../applicant/mvcbean/cdi/jsp/el/Fields.java       |  89 ++++++
 .../mvcbean/cdi/jsp/event/MvcEventListener.java    |  73 +++++
 .../mvcbean/cdi/jsp/portlet/ApplicantPortlet.java  |  69 +++++
 .../mvcbean/cdi/jsp/portlet/PortletContainer.java  |  57 ++++
 .../mvcbean/cdi/jsp/service/CityService.java       |  28 ++
 .../mvcbean/cdi/jsp/service/ProvinceService.java   |  32 ++
 .../cdi/jsp/service/mock/CityServiceMockImpl.java  |  83 ++++++
 .../jsp/service/mock/ProvinceServiceMockImpl.java  |  86 ++++++
 .../cdi/jsp/servlet/AttachmentSessionListener.java |  64 ++++
 .../main/resources/ValidationMessages.properties   |  25 ++
 .../src/main/resources/content/portlet1.properties |  63 ++++
 .../src/main/resources/log4j.properties            |  25 ++
 .../src/main/webapp/WEB-INF/beans.xml              |  24 ++
 .../src/main/webapp/WEB-INF/liferay-display.xml    |  26 ++
 .../WEB-INF/liferay-plugin-package.properties      |  29 ++
 .../src/main/webapp/WEB-INF/views/acceptance.jspx  |  39 +++
 .../src/main/webapp/WEB-INF/views/applicant.jspx   | 328 +++++++++++++++++++++
 .../main/webapp/WEB-INF/views/confirmation.jspx    |  37 +++
 .../src/main/webapp/WEB-INF/views/help.jspx        |  26 ++
 .../src/main/webapp/WEB-INF/views/preferences.jspx |  49 +++
 .../src/main/webapp/WEB-INF/views/terms.jspx       |  53 ++++
 .../src/main/webapp/images/icon-delete.png         | Bin 0 -> 948 bytes
 .../src/main/webapp/images/icon-help.png           | Bin 0 -> 3595 bytes
 .../pom.xml                                        | 111 +++++++
 .../controller/ApplicantActionController.java      | 106 +++++++
 .../controller/ApplicantRenderController.java      | 123 ++++++++
 .../controller/ApplicantResourceController.java    | 191 ++++++++++++
 .../thymeleaf/controller/AttachmentManager.java    |  65 ++++
 .../cdi/thymeleaf/controller/ControllerUtil.java   |  34 +++
 .../thymeleaf/controller/HelpRenderController.java |  36 +++
 .../controller/PreferencesActionController.java    | 134 +++++++++
 .../controller/PreferencesRenderController.java    |  63 ++++
 .../controller/TermsResourceController.java        |  98 ++++++
 .../cdi/thymeleaf/convert/DateParamConverter.java  |  54 ++++
 .../convert/DateParamConverterProvider.java        |  52 ++++
 .../mvcbean/cdi/thymeleaf/dto/Applicant.java       | 177 +++++++++++
 .../mvcbean/cdi/thymeleaf/dto/Attachment.java      |  47 +++
 .../applicant/mvcbean/cdi/thymeleaf/dto/City.java  |  61 ++++
 .../mvcbean/cdi/thymeleaf/dto/Preferences.java     |  44 +++
 .../mvcbean/cdi/thymeleaf/dto/Province.java        |  49 +++
 .../mvcbean/cdi/thymeleaf/el/Converter.java        |  86 ++++++
 .../mvcbean/cdi/thymeleaf/el/Expression.java       |  48 +++
 .../applicant/mvcbean/cdi/thymeleaf/el/Fields.java |  89 ++++++
 .../cdi/thymeleaf/event/MvcEventListener.java      |  73 +++++
 .../cdi/thymeleaf/portlet/ApplicantPortlet.java    |  69 +++++
 .../cdi/thymeleaf/portlet/PortletContainer.java    |  57 ++++
 .../mvcbean/cdi/thymeleaf/service/CityService.java |  28 ++
 .../cdi/thymeleaf/service/ProvinceService.java     |  32 ++
 .../service/mock/CityServiceMockImpl.java          |  83 ++++++
 .../service/mock/ProvinceServiceMockImpl.java      |  86 ++++++
 .../servlet/AttachmentSessionListener.java         |  64 ++++
 .../main/resources/ValidationMessages.properties   |  25 ++
 .../src/main/resources/content/portlet1.properties |  63 ++++
 .../src/main/resources/log4j.properties            |  25 ++
 .../src/main/webapp/WEB-INF/beans.xml              |  24 ++
 .../src/main/webapp/WEB-INF/liferay-display.xml    |  26 ++
 .../WEB-INF/liferay-plugin-package.properties      |  29 ++
 .../src/main/webapp/WEB-INF/views/acceptance.html  |  28 ++
 .../src/main/webapp/WEB-INF/views/applicant.html   | 256 ++++++++++++++++
 .../main/webapp/WEB-INF/views/confirmation.html    |  27 ++
 .../src/main/webapp/WEB-INF/views/help.html        |  22 ++
 .../src/main/webapp/WEB-INF/views/preferences.html |  34 +++
 .../src/main/webapp/WEB-INF/views/terms.html       |  43 +++
 .../src/main/webapp/images/icon-delete.png         | Bin 0 -> 948 bytes
 .../src/main/webapp/images/icon-help.png           | Bin 0 -> 3595 bytes
 demo/chat-room-demo-portlet/pom.xml                |  50 ----
 demo/hub-demo-portlet/pom.xml                      |  39 +--
 demo/pom.xml                                       |  35 +++
 demo/v3-annotated-demo-portlet/pom.xml             |  30 --
 demo/v3-demo-portlet/pom.xml                       |  30 --
 dist-build.xml                                     |   1 +
 .../main/resources/pluto-portal-driver-config.xml  |   3 +
 90 files changed, 5624 insertions(+), 146 deletions(-)

diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/pom.xml b/demo/applicant-mvcbean-cdi-jsp-portlet/pom.xml
new file mode 100644
index 0000000..211e303
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/pom.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+   license agreements. See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership. The ASF licenses this file to
+   you under the Apache License, Version 2.0 (the "License"); you may not use
+   this file except in compliance with the License. You may obtain a copy of
+   the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+   by applicable law or agreed to in writing, software distributed under the
+   License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+   OF ANY KIND, either express or implied. See the License for the specific
+   language governing permissions and limitations under the License. -->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.portals.pluto</groupId>
+		<artifactId>demo</artifactId>
+		<version>3.0.2-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<packaging>war</packaging>
+	<artifactId>applicant-mvcbean-cdi-jsp-portlet</artifactId>
+	<name>applicant-mvcbean-cdi-jsp-portlet</name>
+	<description>Applicant - MVCBean CDI Portlet (JSP)</description>
+	<profiles>
+		<profile>
+			<id>liferay-cdi</id>
+			<build>
+				<finalName>${project.artifactId}</finalName>
+				<plugins>
+					<plugin>
+						<artifactId>maven-war-plugin</artifactId>
+						<configuration>
+							<failOnMissingWebXml>false</failOnMissingWebXml>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-validator</artifactId>
+					<exclusions>
+						<exclusion>
+							<groupId>javax.validation</groupId>
+							<artifactId>validation-api</artifactId>
+						</exclusion>
+					</exclusions>
+				</dependency>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-validator-cdi</artifactId>
+				</dependency>
+			</dependencies>
+		</profile>
+		<profile>
+			<id>pluto</id>
+			<build>
+				<finalName>${project.artifactId}</finalName>
+				<plugins>
+					<plugin>
+						<artifactId>maven-war-plugin</artifactId>
+						<configuration>
+							<failOnMissingWebXml>false</failOnMissingWebXml>
+							<packagingExcludes>
+								WEB-INF/liferay-display.xml,
+								WEB-INF/liferay-plugin-package.properties
+							</packagingExcludes>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.apache.taglibs</groupId>
+					<artifactId>taglibs-standard-jstlel</artifactId>
+				</dependency>
+			</dependencies>
+		</profile>
+	</profiles>
+	<dependencies>
+		<dependency>
+			<groupId>javax.mvc</groupId>
+			<artifactId>javax.mvc-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.ws.rs</groupId>
+			<artifactId>javax.ws.rs-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.portlet</groupId>
+			<artifactId>portlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.validation</groupId>
+			<artifactId>validation-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+		</dependency>
+	</dependencies>
+</project>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantActionController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantActionController.java
new file mode 100644
index 0000000..1f4384d
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantActionController.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.annotations.ActionMethod;
+import javax.portlet.annotations.PortletRequestScoped;
+import javax.validation.Valid;
+import javax.ws.rs.BeanParam;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Applicant;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Attachment;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Controller
+@PortletRequestScoped // Injection of the @Dependent pseudo-scoped @BeanPram Applicant requires this controller to be
+					  // @PortletRequestScoped instead of @ApplicationScoped.
+public class ApplicantActionController {
+
+	private static final Logger logger = LoggerFactory.getLogger(ApplicantActionController.class);
+
+	@Inject
+	@BeanParam
+	@Valid
+	private Applicant applicant;
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private BindingResult bindingResult;
+
+	@Inject
+	private Models models;
+
+	@ActionMethod(portletName = "portlet1", actionName = "submitApplicant")
+	@CsrfProtected
+	public String submitApplicant(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		models.put("applicant", applicant);
+
+		Set<ParamError> bindingErrors = bindingResult.getAllErrors();
+
+		if (bindingErrors.isEmpty()) {
+
+			PortletSession portletSession = actionRequest.getPortletSession();
+			List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+			if (logger.isDebugEnabled()) {
+				logger.debug("firstName=" + applicant.getFirstName());
+				logger.debug("lastName=" + applicant.getLastName());
+				logger.debug("emailAddress=" + applicant.getEmailAddress());
+				logger.debug("phoneNumber=" + applicant.getPhoneNumber());
+				logger.debug("dateOfBirth=" + applicant.getDateOfBirth());
+				logger.debug("city=" + applicant.getCity());
+				logger.debug("provinceId=" + applicant.getProvinceId());
+				logger.debug("postalCode=" + applicant.getPostalCode());
+				logger.debug("comments=" + applicant.getComments());
+			}
+
+			for (Attachment attachment : attachments) {
+
+				logger.debug("attachment=[{}]", attachment.getName());
+
+				File file = attachment.getFile();
+				file.delete();
+			}
+
+			return "redirect:confirmation.jspx";
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantRenderController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantRenderController.java
new file mode 100644
index 0000000..dc630dc
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantRenderController.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.CDI;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.engine.ViewEngineContext;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.annotations.RenderMethod;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Applicant;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Attachment;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class ApplicantRenderController {
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@Inject
+	private ProvinceService provinceService;
+
+	@Inject
+	private ViewEngineContext viewEngineContext;
+
+	@RenderMethod(portletNames = { "portlet1" })
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public String prepareView(RenderRequest renderRequest, RenderResponse renderResponse) {
+
+		String viewName = viewEngineContext.getView();
+
+		if (viewName == null) {
+
+			viewName = "applicant.jspx";
+
+			Applicant applicant = (Applicant) models.get("applicant");
+
+			if (applicant == null) {
+				applicant = new Applicant();
+				models.put("applicant", applicant);
+			}
+
+			PortletSession portletSession = renderRequest.getPortletSession();
+			List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+			applicant.setAttachments(attachments);
+
+			String datePattern = portletPreferences.getValue("datePattern", null);
+
+			models.put("jQueryDatePattern", _getJQueryDatePattern(datePattern));
+
+			models.put("provinces", provinceService.getAllProvinces());
+
+			CDI<Object> currentCDI = CDI.current();
+			BeanManager beanManager = currentCDI.getBeanManager();
+			Class<? extends BeanManager> beanManagerClass = beanManager.getClass();
+			Package beanManagerPackage = beanManagerClass.getPackage();
+			models.put("weldVersion", beanManagerPackage.getImplementationVersion());
+		}
+
+		return viewName;
+	}
+
+	private String _getJQueryDatePattern(String datePattern) {
+
+		String jQueryDatePattern = datePattern;
+
+		if (datePattern.contains("yyyy")) {
+			jQueryDatePattern = datePattern.replaceAll("yyyy", "yy");
+		}
+		else if (datePattern.contains("yy")) {
+			jQueryDatePattern = datePattern.replaceAll("yy", "y");
+		}
+
+		jQueryDatePattern = jQueryDatePattern.replaceAll("M", "m");
+
+		return jQueryDatePattern;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantResourceController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantResourceController.java
new file mode 100644
index 0000000..d7d8d2f
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/ApplicantResourceController.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.PortletSession;
+import javax.portlet.ResourceParameters;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.ServeResourceMethod;
+import javax.servlet.http.Part;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Attachment;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.City;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.CityService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class ApplicantResourceController {
+
+	private static final Logger logger = LoggerFactory.getLogger(ApplicantResourceController.class);
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private CityService cityService;
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "autoFill")
+	public void autoFill(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		String postalCode = resourceParameters.getValue(resourceResponse.getNamespace() + "postalCode");
+
+		if (postalCode != null) {
+
+			try {
+				City city = cityService.getCityByPostalCode(postalCode);
+
+				if (city != null) {
+
+					Writer writer = resourceResponse.getWriter();
+
+					writer.write("{");
+					writer.write("\"cityName\": \"");
+					writer.write(city.getCityName());
+					writer.write("\",");
+					writer.write("\"provinceId\": \"");
+					writer.write(String.valueOf(city.getProvinceId()));
+					writer.write("\"}");
+				}
+			}
+			catch (IOException e) {
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "deleteFile")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public void deleteFile(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		PortletSession portletSession = resourceRequest.getPortletSession();
+
+		List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		String attachmentIndex = resourceParameters.getValue(resourceResponse.getNamespace() + "attachmentIndex");
+
+		if (attachmentIndex != null) {
+			Attachment attachment = attachments.remove(Integer.valueOf(attachmentIndex).intValue());
+
+			try {
+				File file = attachment.getFile();
+				file.delete();
+				_writeTabularJSON(resourceResponse.getWriter(), attachments);
+			}
+			catch (IOException e) {
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "uploadFiles")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public void uploadFiles(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		PortletSession portletSession = resourceRequest.getPortletSession(true);
+		List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+		try {
+			Collection<Part> transientMultipartFiles = resourceRequest.getParts();
+
+			if (!transientMultipartFiles.isEmpty()) {
+
+				File attachmentDir = attachmentManager.getAttachmentDir(portletSession.getId());
+
+				if (!attachmentDir.exists()) {
+					attachmentDir.mkdir();
+				}
+
+				for (Part transientMultipartFile : transientMultipartFiles) {
+
+					String submittedFileName = transientMultipartFile.getSubmittedFileName();
+
+					if (submittedFileName != null) {
+						File copiedFile = new File(attachmentDir, submittedFileName);
+
+						transientMultipartFile.write(copiedFile.getAbsolutePath());
+
+						attachments.add(new Attachment(copiedFile));
+					}
+				}
+
+				_writeTabularJSON(resourceResponse.getWriter(), attachments);
+			}
+		}
+		catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+	}
+
+	private void _writeTabularJSON(Writer writer, List<Attachment> attachments) {
+
+		try {
+
+			writer.write("[");
+
+			boolean first = true;
+
+			for (Attachment attachment : attachments) {
+
+				if (first) {
+					first = false;
+				}
+				else {
+					writer.write(",");
+				}
+
+				writer.write("{\"fileName\": \"");
+
+				writer.write(attachment.getName());
+				writer.write("\",\"size\":\"");
+				writer.write(String.valueOf(attachment.getSize()));
+				writer.write("\"}");
+			}
+
+			writer.write("]");
+		}
+		catch (IOException e) {
+			logger.error(e.getMessage(), e);
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/AttachmentManager.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/AttachmentManager.java
new file mode 100644
index 0000000..dc915e3
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/AttachmentManager.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Attachment;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class AttachmentManager {
+
+	@Inject
+	private ServletContext servletContext;
+
+	public File getAttachmentDir(String sessionId) {
+
+		File tempDir = (File) servletContext.getAttribute(ServletContext.TEMPDIR);
+
+		return new File(tempDir, sessionId);
+	}
+
+	public List<Attachment> getAttachments(String sessionId) {
+		return getAttachments(getAttachmentDir(sessionId));
+	}
+
+	public List<Attachment> getAttachments(File attachmentDir) {
+
+		List<Attachment> attachments = new ArrayList<>();
+
+		if (attachmentDir.exists()) {
+
+			File[] files = attachmentDir.listFiles();
+
+			for (File file : files) {
+				attachments.add(new Attachment(file));
+			}
+		}
+
+		return attachments;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/HelpRenderController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/HelpRenderController.java
new file mode 100644
index 0000000..7af8b9f
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/HelpRenderController.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.mvc.Controller;
+import javax.mvc.View;
+import javax.portlet.annotations.RenderMethod;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class HelpRenderController {
+
+	@Controller
+	@RenderMethod(portletNames = { "portlet1" }, portletMode = "help")
+	@View("help.jspx")
+	public void renderHelpMode() {
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesActionController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesActionController.java
new file mode 100644
index 0000000..9a28c6a
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesActionController.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.util.Enumeration;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.WindowState;
+import javax.portlet.annotations.ActionMethod;
+import javax.portlet.annotations.PortletRequestScoped;
+import javax.validation.constraints.NotBlank;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+import javax.ws.rs.FormParam;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Preferences;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Controller
+@PortletRequestScoped // Injection of the @Dependent pseudo-scoped @FormParam String requires this controller to be
+					  // @PortletRequestScoped instead of @ApplicationScoped.
+@View("preferences.jspx")
+public class PreferencesActionController {
+
+	private static final Logger logger = LoggerFactory.getLogger(PreferencesActionController.class);
+
+	@Inject
+	private BindingResult bindingResult;
+
+	@Inject
+	@FormParam("datePattern")
+	@NotBlank
+	private String datePattern;
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletConfig portletConfig;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@ActionMethod(portletName = "portlet1", actionName = "reset")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	@CsrfProtected
+	public void resetPreferences(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		ResourceBundle resourceBundle = portletConfig.getResourceBundle(actionRequest.getLocale());
+
+		try {
+
+			Enumeration<String> preferenceNames = portletPreferences.getNames();
+
+			while (preferenceNames.hasMoreElements()) {
+				String preferenceName = preferenceNames.nextElement();
+
+				if (!portletPreferences.isReadOnly(preferenceName)) {
+					portletPreferences.reset(preferenceName);
+				}
+			}
+
+			portletPreferences.store();
+			actionResponse.setPortletMode(PortletMode.VIEW);
+			actionResponse.setWindowState(WindowState.NORMAL);
+			models.put("globalInfoMessage", resourceBundle.getString("your-request-processed-successfully"));
+		}
+		catch (Exception e) {
+
+			models.put("globalErrorMessage", resourceBundle.getString("an-unexpected-error-occurred"));
+
+			logger.error(e.getMessage(), e);
+		}
+	}
+
+	@ActionMethod(portletName = "portlet1", actionName = "submitPreferences")
+	@CsrfProtected
+	public void submitPreferences(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		ResourceBundle resourceBundle = portletConfig.getResourceBundle(actionRequest.getLocale());
+
+		models.put("preferences", new Preferences(datePattern));
+
+		Set<ParamError> bindingErrors = bindingResult.getAllErrors();
+
+		if (bindingErrors.isEmpty()) {
+
+			try {
+				portletPreferences.setValue("datePattern", datePattern);
+				portletPreferences.store();
+				actionResponse.setPortletMode(PortletMode.VIEW);
+				actionResponse.setWindowState(WindowState.NORMAL);
+				models.put("globalInfoMessage", resourceBundle.getString("your-request-processed-successfully"));
+			}
+			catch (Exception e) {
+				models.put("globalErrorMessage", resourceBundle.getString("an-unexpected-error-occurred"));
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesRenderController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesRenderController.java
new file mode 100644
index 0000000..86f3f37
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/PreferencesRenderController.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.portlet.PortletPreferences;
+import javax.portlet.annotations.RenderMethod;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Preferences;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class PreferencesRenderController {
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@RenderMethod(portletNames = { "portlet1" }, portletMode = "edit")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	@View("preferences.jspx")
+	public void prepareView() {
+
+		Map<String, Object> modelsMap = models.asMap();
+
+		if (!modelsMap.containsKey("preferences")) {
+			models.put("preferences", new Preferences(portletPreferences.getValue("datePattern", null)));
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/TermsResourceController.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/TermsResourceController.java
new file mode 100644
index 0000000..7ffc850
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/controller/TermsResourceController.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.controller;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.ResourceParameters;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.ServeResourceMethod;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class TermsResourceController {
+
+	private static final Logger logger = LoggerFactory.getLogger(TermsResourceController.class);
+
+	@Inject
+	private Models models;
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "acceptTerms")
+	public String acceptTerms(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+		return "redirect:acceptance.jspx";
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html")
+	public void redirectedView(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		logger.debug("redirectedView=[{}]", resourceParameters.getValue("redirectedView"));
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "viewTerms")
+	@View("terms.jspx")
+	public void viewTerms(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		DateFormat dateFormat = new SimpleDateFormat("yyyy");
+
+		Calendar todayCalendar = Calendar.getInstance();
+
+		models.put("thisYear", dateFormat.format(todayCalendar.getTime()));
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "viewTermsAgain")
+	@View("redirect:terms.jspx")
+	public void viewTermsAgain(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+		logger.debug("Redirecting to Terms of Service");
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverter.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverter.java
new file mode 100644
index 0000000..4fc27d0
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverter.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.convert;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.portlet.PortletPreferences;
+import javax.ws.rs.ext.ParamConverter;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class DateParamConverter implements ParamConverter<Date> {
+
+	private DateFormat dateFormat;
+
+	public DateParamConverter(PortletPreferences portletPreferences) {
+		this.dateFormat = new SimpleDateFormat(portletPreferences.getValue("datePattern", null));
+	}
+
+	@Override
+	public Date fromString(String value) {
+
+		try {
+			return dateFormat.parse(value);
+		}
+		catch (ParseException e) {
+			throw new IllegalArgumentException(e);
+		}
+	}
+
+	@Override
+	public String toString(Date date) {
+		return dateFormat.format(date);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverterProvider.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverterProvider.java
new file mode 100644
index 0000000..42be423
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/convert/DateParamConverterProvider.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.convert;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Date;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.portlet.PortletPreferences;
+import javax.ws.rs.ext.ParamConverter;
+import javax.ws.rs.ext.ParamConverterProvider;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class DateParamConverterProvider implements ParamConverterProvider {
+
+	@Inject
+	protected PortletPreferences portletPreferences;
+
+	@Override
+	public <T> ParamConverter<T> getConverter(Class<T> rawType, Type baseType, Annotation[] annotations) {
+
+		if (rawType == null) {
+			return null;
+		}
+
+		if (rawType.equals(Date.class)) {
+			return (ParamConverter<T>) new DateParamConverter(portletPreferences);
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Applicant.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Applicant.java
new file mode 100644
index 0000000..94cccd1
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Applicant.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import javax.enterprise.context.Dependent;
+import javax.inject.Inject;
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Past;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.ws.rs.FormParam;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Dependent
+public class Applicant implements Serializable {
+
+	private static final long serialVersionUID = 2774594923346476261L;
+
+	private List<Attachment> attachments;
+
+	@Inject
+	@FormParam("city")
+	@NotBlank
+	private String city;
+
+	private String comments;
+
+	@Inject
+	@FormParam("dateOfBirth")
+	@NotNull
+	@Past
+	private Date dateOfBirth;
+
+	@Inject
+	@FormParam("emailAddress")
+	@Email
+	@NotBlank
+	private String emailAddress;
+
+	@Inject
+	@FormParam("firstName")
+	@NotBlank
+	private String firstName;
+
+	@Inject
+	@FormParam("lastName")
+	@NotBlank
+	private String lastName;
+
+	@Inject
+	@FormParam("phoneNumber")
+	@NotBlank
+	@Pattern(regexp = "([0-9]+)")
+	private String phoneNumber;
+
+	@Inject
+	@FormParam("postalCode")
+	@NotBlank
+	private String postalCode;
+
+	@Inject
+	@FormParam("provinceId")
+	@NotNull
+	@Positive
+	private Long provinceId;
+
+	public Applicant() {
+
+		Calendar calendar = new GregorianCalendar();
+		this.dateOfBirth = calendar.getTime();
+	}
+
+	public List<Attachment> getAttachments() {
+		return attachments;
+	}
+
+	public String getCity() {
+		return city;
+	}
+
+	public String getComments() {
+		return comments;
+	}
+
+	public Date getDateOfBirth() {
+		return dateOfBirth;
+	}
+
+	public String getEmailAddress() {
+		return emailAddress;
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public String getPhoneNumber() {
+		return phoneNumber;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public Long getProvinceId() {
+		return provinceId;
+	}
+
+	public void setAttachments(List<Attachment> attachments) {
+		this.attachments = attachments;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public void setComments(String comments) {
+		this.comments = comments;
+	}
+
+	public void setDateOfBirth(Date dateOfBirth) {
+		this.dateOfBirth = dateOfBirth;
+	}
+
+	public void setEmailAddress(String emailAddress) {
+		this.emailAddress = emailAddress;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public void setPhoneNumber(String phoneNumber) {
+		this.phoneNumber = phoneNumber;
+	}
+
+	public void setPostalCode(String postalCode) {
+		this.postalCode = postalCode;
+	}
+
+	public void setProvinceId(Long provinceId) {
+		this.provinceId = provinceId;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Attachment.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Attachment.java
new file mode 100644
index 0000000..afd9b66
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Attachment.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto;
+
+import java.io.File;
+import java.io.Serializable;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class Attachment implements Serializable {
+
+	private static final long serialVersionUID = 1572382923498234661L;
+
+	private final File file;
+
+	public Attachment(File file) {
+		this.file = file;
+	}
+
+	public File getFile() {
+		return file;
+	}
+
+	public String getName() {
+		return file.getName();
+	}
+
+	public long getSize() {
+		return file.length();
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/City.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/City.java
new file mode 100644
index 0000000..848f061
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/City.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto;
+
+import java.io.Serializable;
+
+
+/**
+ * This is a bean that represents a City and implements the Transfer Object (formerly known as ValueObject/VO) design
+ * pattern.
+ *
+ * @author  "Neil Griffin"
+ */
+public class City implements Serializable {
+
+	// serialVersionUID
+	private static final long serialVersionUID = 3312342177113327761L;
+
+	// JavaBean Properties
+	private final long cityId;
+	private final String cityName;
+	private final String postalCode;
+	private final long provinceId;
+
+	public City(long cityId, long provinceId, String cityName, String postalCode) {
+		this.cityId = cityId;
+		this.provinceId = provinceId;
+		this.cityName = cityName;
+		this.postalCode = postalCode;
+	}
+
+	public long getCityId() {
+		return cityId;
+	}
+
+	public String getCityName() {
+		return cityName;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public long getProvinceId() {
+		return provinceId;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Preferences.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Preferences.java
new file mode 100644
index 0000000..acf3ca1
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Preferences.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto;
+
+import javax.validation.constraints.NotBlank;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class Preferences {
+
+	@NotBlank
+	private String datePattern;
+
+	public Preferences() {
+	}
+
+	public Preferences(String datePattern) {
+		this.datePattern = datePattern;
+	}
+
+	public String getDatePattern() {
+		return datePattern;
+	}
+
+	public void setDatePattern(String datePattern) {
+		this.datePattern = datePattern;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Province.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Province.java
new file mode 100755
index 0000000..b2fbf6d
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/dto/Province.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto;
+
+import java.io.Serializable;
+
+
+/**
+ * This is a bean that represents a Province and implements the Transfer Object (formerly known as ValueObject/VO)
+ * design pattern.
+ *
+ * @author  "Neil Griffin"
+ */
+public class Province implements Serializable {
+
+	// serialVersionUID
+	private static final long serialVersionUID = 2342374742262228819L;
+
+	// JavaBean Properties
+	private final long provinceId;
+	private final String provinceName;
+
+	public Province(long provinceId, String provinceName) {
+		this.provinceId = provinceId;
+		this.provinceName = provinceName;
+	}
+
+	public long getProvinceId() {
+		return provinceId;
+	}
+
+	public String getProvinceName() {
+		return provinceName;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Converter.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Converter.java
new file mode 100644
index 0000000..db3710a
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Converter.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.el;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.Date;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.mvc.Models;
+import javax.portlet.PortletPreferences;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.convert.DateParamConverter;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Named
+public class Converter {
+
+	private static final Logger logger = LoggerFactory.getLogger(Converter.class);
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@Inject
+	private Models models;
+
+	public Object convert(String exp) {
+
+		if (exp == null) {
+			return null;
+		}
+
+		Expression expression = new Expression(exp);
+
+		Object base = models.get(expression.getBase());
+
+		if (base == null) {
+			return null;
+		}
+
+		Class<?> baseClass = base.getClass();
+
+		try {
+			PropertyDescriptor propertyDescriptor = new PropertyDescriptor(expression.getProperty(), baseClass);
+			Method readMethod = propertyDescriptor.getReadMethod();
+
+			Object invoke = readMethod.invoke(base);
+
+			if (invoke == null) {
+				return null;
+			}
+
+			DateParamConverter dateParamConverter = new DateParamConverter(portletPreferences);
+
+			return dateParamConverter.toString((Date) invoke);
+		}
+		catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Expression.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Expression.java
new file mode 100644
index 0000000..eb43cf8
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Expression.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.el;
+
+/**
+ * @author  Neil Griffin
+ */
+class Expression {
+
+	private final String base;
+	private final String property;
+
+	public Expression(String expression) {
+
+		int pos = expression.indexOf(".");
+
+		if (pos < 0) {
+			base = null;
+			property = expression;
+		}
+		else {
+			base = expression.substring(0, pos);
+			property = expression.substring(pos + 1);
+		}
+	}
+
+	public String getBase() {
+		return base;
+	}
+
+	public String getProperty() {
+		return property;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Fields.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Fields.java
new file mode 100644
index 0000000..981e457
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/el/Fields.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.el;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Named
+@ApplicationScoped
+public class Fields {
+
+	@Inject
+	private BindingResult bindingResult;
+
+	public String error(String field) {
+
+		StringBuilder sb = new StringBuilder();
+		Collection<String> errors = errors(field);
+
+		boolean first = true;
+
+		for (String error : errors) {
+
+			if (first) {
+				first = false;
+			}
+			else {
+				sb.append(" ");
+			}
+
+			sb.append(error);
+		}
+
+		return sb.toString();
+	}
+
+	public Collection<String> errors(String field) {
+
+		if (field == null) {
+			return null;
+		}
+
+		Set<String> errors = new LinkedHashSet<>();
+
+		Set<ParamError> bindingResultErrors = bindingResult.getErrors(field);
+
+		for (ParamError bindingResultError : bindingResultErrors) {
+			errors.add(bindingResultError.getMessage());
+		}
+
+		return errors;
+	}
+
+	public boolean hasErrors(String field) {
+
+		if (field == null) {
+			return false;
+		}
+
+		Set<ParamError> bindingResultErrors = bindingResult.getErrors(field);
+
+		return !bindingResultErrors.isEmpty();
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/event/MvcEventListener.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/event/MvcEventListener.java
new file mode 100644
index 0000000..9fde41c
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/event/MvcEventListener.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.event;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.mvc.event.AfterControllerEvent;
+import javax.mvc.event.AfterProcessViewEvent;
+import javax.mvc.event.BeforeControllerEvent;
+import javax.mvc.event.BeforeProcessViewEvent;
+import javax.mvc.event.ControllerRedirectEvent;
+import javax.mvc.event.MvcEvent;
+import javax.ws.rs.container.ResourceInfo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class MvcEventListener {
+
+	private static final Logger logger = LoggerFactory.getLogger(MvcEventListener.class);
+
+	public void afterControllerEventListener(@Observes AfterControllerEvent afterControllerEvent) {
+		ResourceInfo resourceInfo = afterControllerEvent.getResourceInfo();
+
+		logger.debug("Observed AfterControllerEvent class=[{}], method=[{}]", resourceInfo.getResourceClass(),
+			resourceInfo.getResourceMethod());
+	}
+
+	public void afterProcessViewEventListener(@Observes AfterProcessViewEvent afterProcessViewEvent) {
+		logger.debug("Observed AfterProcesssViewEvent view=[{}]", afterProcessViewEvent.getView());
+	}
+
+	public void beforeControllerEventListener(@Observes BeforeControllerEvent beforeControllerEvent) {
+		ResourceInfo resourceInfo = beforeControllerEvent.getResourceInfo();
+
+		logger.debug("Observed BeforeControllerEvent class=[{}], method=[{}]", resourceInfo.getResourceClass(),
+			resourceInfo.getResourceMethod());
+	}
+
+	public void beforeProcessViewEventListener(@Observes BeforeProcessViewEvent beforeProcessViewEvent) {
+		logger.debug("Observed BeforeProcesssViewEvent view=[{}]", beforeProcessViewEvent.getView());
+	}
+
+	public void controllerRedirectEventListener(@Observes ControllerRedirectEvent controllerRedirectEvent) {
+		ResourceInfo resourceInfo = controllerRedirectEvent.getResourceInfo();
+
+		logger.debug("Observed ControllerRedirectEvent class=[{}], method=[{}] location=[{}]",
+			resourceInfo.getResourceClass(), resourceInfo.getResourceMethod(), controllerRedirectEvent.getLocation());
+	}
+
+	public void mvcEventListener(@Observes MvcEvent mvcEvent) {
+		logger.trace("Observed MvcEvent=[{}]", mvcEvent);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/ApplicantPortlet.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/ApplicantPortlet.java
new file mode 100644
index 0000000..87dbeda
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/ApplicantPortlet.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.portlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.annotations.HeaderMethod;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.annotations.Preference;
+import javax.portlet.annotations.Supports;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@PortletConfiguration(
+	portletName = "portlet1", prefs = { @Preference(name = "datePattern", values = { "MM/dd/yyyy" }) },
+	supports = { @Supports(portletModes = { "view", "edit", "help" }) }, resourceBundle = "content.portlet1"
+)
+public class ApplicantPortlet implements HeaderPortlet {
+
+	@Override
+	@HeaderMethod(portletNames = { "portlet1" })
+	public void renderHeaders(HeaderRequest headerRequest, HeaderResponse headerResponse) throws PortletException,
+		IOException {
+
+		boolean liferayDetected = PortletContainer.LIFERAY.isDetected(headerRequest);
+		boolean plutoDetected = PortletContainer.PLUTO.isDetected(headerRequest);
+
+		if (plutoDetected) {
+			headerResponse.addDependency("jQuery", "com.jquery", "1.12.1",
+				"<script src=\"https://code.jquery.com/jquery-1.12.4.js\"></script>");
+			headerResponse.addDependency("Bootstrap", "com.getbootstrap", "4.0.0",
+				"<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\" integrity=\"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm\" crossorigin=\"anonymous\">");
+
+			PrintWriter writer = headerResponse.getWriter();
+			writer.write(
+				"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"></meta>");
+		}
+
+		if (liferayDetected || plutoDetected) {
+			headerResponse.addDependency("jQueryUI", "com.jquery", "1.12.1",
+				"<script src=\"https://code.jquery.com/ui/1.12.1/jquery-ui.js\"></script>");
+			headerResponse.addDependency("jQueryUICSS", "com.jquery", "1.12.1",
+				"<link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">");
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/PortletContainer.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/PortletContainer.java
new file mode 100644
index 0000000..3c56406
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/portlet/PortletContainer.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.portlet;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.filter.PortletRequestWrapper;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public enum PortletContainer {
+
+	LIFERAY("com.liferay"), PLUTO("org.apache.pluto"), WEBSPHERE("com.ibm");
+
+	private final String fqcnPrefix;
+
+	PortletContainer(String fqcnPrefix) {
+		this.fqcnPrefix = fqcnPrefix;
+	}
+
+	public boolean isDetected(PortletRequest portletRequest) {
+
+		portletRequest = unwrapPortletRequest(portletRequest);
+
+		Class<? extends PortletRequest> portletRequestClass = portletRequest.getClass();
+
+		String portletRequestClassName = portletRequestClass.getName();
+
+		return portletRequestClassName.startsWith(fqcnPrefix);
+	}
+
+	private PortletRequest unwrapPortletRequest(PortletRequest portletRequest) {
+
+		if (portletRequest instanceof PortletRequestWrapper) {
+			PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest;
+
+			return unwrapPortletRequest(portletRequestWrapper.getRequest());
+		}
+
+		return portletRequest;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/CityService.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/CityService.java
new file mode 100644
index 0000000..7581ea0
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/CityService.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.City;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public interface CityService {
+
+	public City getCityByPostalCode(String postalCode);
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/ProvinceService.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/ProvinceService.java
new file mode 100644
index 0000000..3ade51b
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/ProvinceService.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service;
+
+import java.util.List;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Province;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public interface ProvinceService {
+
+	public List<Province> getAllProvinces();
+
+	public long getProvinceId(String provinceName);
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/CityServiceMockImpl.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/CityServiceMockImpl.java
new file mode 100644
index 0000000..7d923d9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/CityServiceMockImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.mock;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.City;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.CityService;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class CityServiceMockImpl implements CityService {
+
+	@Inject
+	private ProvinceService provinceService;
+
+	// Private Data Members
+	private List<City> cities;
+
+	@Override
+	public City getCityByPostalCode(String postalCode) {
+
+		for (City city : cities) {
+
+			if (city.getPostalCode().equals(postalCode)) {
+				return city;
+			}
+		}
+
+		return null;
+	}
+
+	@PostConstruct
+	public void postConstruct() {
+
+		long cityId = 1;
+		cities = new ArrayList<>();
+
+		City city = new City(cityId++, provinceService.getProvinceId("DE"), "Wilmington", "19806");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("GA"), "Atlanta", "30329");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("FL"), "Orlando", "32801");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("MD"), "Baltimore", "21224");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NC"), "Charlotte", "28202");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NJ"), "Hoboken", "07030");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NY"), "Albany", "12205");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("SC"), "Columbia", "29201");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("VA"), "Roanoke", "24013");
+		cities.add(city);
+		cities = Collections.unmodifiableList(cities);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/ProvinceServiceMockImpl.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/ProvinceServiceMockImpl.java
new file mode 100644
index 0000000..f279bba
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/service/mock/ProvinceServiceMockImpl.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.mock;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.dto.Province;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class ProvinceServiceMockImpl implements ProvinceService {
+
+	private List<Province> provinces;
+
+	@Override
+	public List<Province> getAllProvinces() {
+		return provinces;
+	}
+
+	@Override
+	public long getProvinceId(String provinceName) {
+		long provinceId = 0;
+		List<Province> provinces = getAllProvinces();
+
+		for (Province province : provinces) {
+
+			if (province.getProvinceName().equals(provinceName)) {
+				provinceId = province.getProvinceId();
+
+				break;
+			}
+		}
+
+		return provinceId;
+	}
+
+	@PostConstruct
+	public void postConstruct() {
+
+		long provinceId = 1;
+		provinces = new ArrayList<>();
+
+		Province province = new Province(provinceId++, "DE");
+		provinces.add(province);
+		province = new Province(provinceId++, "GA");
+		provinces.add(province);
+		province = new Province(provinceId++, "FL");
+		provinces.add(province);
+		province = new Province(provinceId++, "MD");
+		provinces.add(province);
+		province = new Province(provinceId++, "NC");
+		provinces.add(province);
+		province = new Province(provinceId++, "NJ");
+		provinces.add(province);
+		province = new Province(provinceId++, "NY");
+		provinces.add(province);
+		province = new Province(provinceId++, "SC");
+		provinces.add(province);
+		province = new Province(provinceId++, "VA");
+		provinces.add(province);
+		provinces = Collections.unmodifiableList(provinces);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/servlet/AttachmentSessionListener.java b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/servlet/AttachmentSessionListener.java
new file mode 100644
index 0000000..9dca9d9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/jsp/servlet/AttachmentSessionListener.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.jsp.servlet;
+
+import java.io.File;
+
+import javax.servlet.ServletContext;
+import javax.servlet.annotation.WebListener;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@WebListener
+public class AttachmentSessionListener implements HttpSessionListener {
+
+	private static final Logger logger = LoggerFactory.getLogger(AttachmentSessionListener.class);
+
+	@Override
+	public void sessionCreated(HttpSessionEvent httpSessionEvent) {
+	}
+
+	@Override
+	public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
+
+		HttpSession httpSession = httpSessionEvent.getSession();
+		ServletContext servletContext = httpSession.getServletContext();
+		File tempDir = (File) servletContext.getAttribute(ServletContext.TEMPDIR);
+
+		File attachmentDir = new File(tempDir, httpSession.getId());
+
+		if (attachmentDir.exists()) {
+
+			File[] files = attachmentDir.listFiles();
+
+			for (File file : files) {
+
+				file.delete();
+
+				logger.debug("Deleted file: " + file.getAbsolutePath());
+			}
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/ValidationMessages.properties b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/ValidationMessages.properties
new file mode 100644
index 0000000..b9d7d9c
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/ValidationMessages.properties
@@ -0,0 +1,25 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+# https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/resources/org/hibernate/validator/ValidationMessages.properties
+javax.validation.constraints.Email.message=Invalid e-mail address
+javax.validation.constraints.NotNull.message=Value is required
+javax.validation.constraints.NotBlank.message=Value is required
+javax.validation.constraints.Pattern.message=Invalid pattern
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/content/portlet1.properties b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/content/portlet1.properties
new file mode 100644
index 0000000..960692e
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/content/portlet1.properties
@@ -0,0 +1,63 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+accept=Accept
+add-attachment=Add Attachment
+all-rights-reserved=All Rights Reserved.
+an-unexpected-error-occurred=An unexpected error occurred.
+are-you-sure-you-want-to-delete-this=Are you sure you want to delete this?
+attachments=Attachments
+back-to-terms-of-service=Back to Terms of Service
+city=City
+comments=Comments
+copyright=Copyright (C)
+date-format=Date Format
+date-of-birth=Date of Birth
+edit-preferences=Edit Preferences
+email-address=Email Address
+file-name=File Name
+first-name=First Name
+hide=Hide
+javax.portlet.display-name=Applicant MVCBean CDI Portlet (JSP)
+javax.portlet.keywords=Applicant MVCBean CDI Portlet (JSP)
+javax.portlet.short-title=Applicant MVCBean CDI Portlet (JSP)
+javax.portlet.title=Applicant MVCBean CDI Portlet (JSP)
+job-application=Job Application
+last-name=Last Name
+liferay-dot-com=liferay.com
+phone-number=Phone Number
+portlet-help=This portlet demonstrates an MVCBean CDI Portlet with JSP views.
+postal-code-hint=Type any of these ZIP codes: 19806, 30329, 32801, 21224, 28202, 07030, 12205, 29201, 24013
+reset=Reset
+select=Select
+show=Show
+size=Size
+state-province=State
+submit=Submit
+submit-another-application=Submit Another Application
+terms-of-service=Terms of Service
+terms-of-service-point1=By applying for a job with our organization, you are agreeing to our terms of service.
+terms-of-service-point2=We reserve the right to modify our terms of service at without prior notice. 
+terms-of-service-point3=Your email address will not be used for marketing purposes.
+thank-you-for-accepting-our-terms-of-service=Thank you for accepting our terms of service.
+thank-you-for-applying-for-a-job-with-our-organization=Thank you {0} for applying for a job with our organization. Your request has been sent to our human resources department.
+your-request-processed-successfully=Your request processed successfully.
+value-is-required=Value is required
+zip-postal=ZIP Code
\ No newline at end of file
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/log4j.properties b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/log4j.properties
new file mode 100644
index 0000000..4d9a0df
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/resources/log4j.properties
@@ -0,0 +1,25 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+log4j.rootLogger=INFO, R 
+log4j.appender.R=org.apache.log4j.ConsoleAppender 
+log4j.appender.R.layout=org.apache.log4j.PatternLayout 
+log4j.appender.R.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}:%L] %m%n
+log4j.logger.com.liferay.blade.samples.applicant.mvcbean.cdi.jsp=DEBUG
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/beans.xml b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..e15fcf2
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" bean-discovery-mode="all" version="1.2"
+	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
+	<!-- This file is necessary in order to inform CDI that scanning should occur for CDI annotations. -->
+</beans>
\ No newline at end of file
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-display.xml b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-display.xml
new file mode 100755
index 0000000..b438c06
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-display.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 7.1.0//EN" "http://www.liferay.com/dtd/liferay-display_7_1_0.dtd">
+
+<display>
+	<category name="category.sample">
+		<portlet id="portlet1" />
+	</category>
+</display>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties
new file mode 100644
index 0000000..48cd026
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+author=Neil Griffin
+change-log=
+licenses=Apache License, Version 2.0
+liferay-versions=7.2.*
+long-description=
+module-group-id=liferay
+module-incremental-version=1
+name=applicant-mvcbean-cdi-jsp
+page-url=https://portals.apache.org/pluto/
+short-description=
+tags=
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/acceptance.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/acceptance.jspx
new file mode 100644
index 0000000..1ddb2cd
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/acceptance.jspx
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  xmlns:portlet="http://xmlns.jcp.org/portlet_3_0" version="2.1">
+	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
+	<fmt:setBundle basename="content.portlet1" var="i18n"/>
+	<html>
+		<head>
+			<title><fmt:message bundle="${i18n}" key="terms-of-service"/></title>
+		</head>
+		<body>
+			<p>
+				<fmt:message bundle="${i18n}" key="thank-you-for-accepting-our-terms-of-service"/>
+			</p>
+			<portlet:resourceURL id="viewTermsAgain" var="viewTermsAgainResourceURL"/>
+			<a href="${viewTermsAgainResourceURL}">
+				<fmt:message bundle="${i18n}" key="back-to-terms-of-service" />
+			</a>
+		</body>
+	</html>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/applicant.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/applicant.jspx
new file mode 100644
index 0000000..65a564d
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/applicant.jspx
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
+		  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  xmlns:portlet="http://xmlns.jcp.org/portlet_3_0"
+		  version="2.1">
+	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
+	<portlet:defineObjects/>
+	<fmt:setBundle basename="content.portlet1" var="i18n" />
+	<script type="text/javascript">
+		/*<![CDATA[*/
+		var ${namespace}_updateAttachments = function(responseJSON) {
+			$('#${namespace}attachmentsTableBody').empty();
+			$('#${namespace}inputFile').val('');
+			$.each(responseJSON, function(i, item) {
+				$('<tr>').append(
+					$('<td>').append(
+						$('<input>').attr(
+							'type', 'image').attr(
+							'src',
+							'${contextPath}/images/icon-delete.png').attr(
+							'name', 'attachmentIndex').attr('value', i)),
+					$('<td>').text(item.fileName),
+					$('<td>').text(item.size)
+				).appendTo('#${namespace}attachmentsTableBody');
+			});
+		}
+		/*]]>*/
+	</script>
+	<portlet:resourceURL id="autoFill" var="autoFillResourceURL"/>
+	<script type="text/javascript">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#${namespace}postalCode').on('change', function submitXHR(){
+				$.ajax({
+					data: {
+						${mvc.csrf.name}: '${mvc.csrf.token}',
+						${namespace}postalCode: $(this).val()
+					},
+					type: 'post',
+					url: '${autoFillResourceURL}'
+				}).done(function(responseData) {
+					var responseJSON = JSON.parse(responseData);
+					$('#${namespace}city').val(responseJSON['cityName']).change();
+					$('#${namespace}provinceId').val(responseJSON['provinceId']).change();
+				}).fail(function() {
+					console.log('XHR failed');
+				});
+			});
+		});
+		/*]]>*/
+	</script>
+	<fmt:message bundle="${i18n}" key="are-you-sure-you-want-to-delete-this" var="areYouSure"/>
+	<portlet:resourceURL id="deleteFile" var="deleteFileResourceURL"/>
+	<script type="text/javascript">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#${namespace}deleteFileForm').on('click', 'input', function (event) {
+				event.preventDefault();
+				if (confirm('${areYouSure}')) {
+					$.ajax({
+						data: {
+							${namespace}attachmentIndex: event.target.value,
+							${mvc.csrf.name}: '${mvc.csrf.token}'
+						},
+						type: 'post',
+						url: '${deleteFileResourceURL}'
+					}).done(function (responseData) {
+						${namespace}_updateAttachments(JSON.parse(responseData));
+					}).fail(function () {
+						console.log('XHR failed');
+					});
+				}
+			});
+		});
+		/*]]>*/
+	</script>
+	<portlet:resourceURL id="uploadFiles" var="uploadFilesResourceURL"/>
+	<script type="text/javascript">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#${namespace}fileUploadForm').submit(function (event) {
+				event.preventDefault();
+				var formData = new FormData($(this)[0]);
+				$.ajax({
+					async: false,
+					cache: false,
+					contentType: false,
+					data: formData,
+					processData: false,
+					type: 'post',
+					url: '${uploadFilesResourceURL}'
+				}).done(function(responseData) {
+					${namespace}_updateAttachments(JSON.parse(responseData));
+				}).fail(function() {
+					console.log('XHR failed');
+				});
+			});
+		});
+		/*]]>*/
+	</script>
+	<fmt:message bundle="${i18n}" key="value-is-required" var="valueIsRequired"/>
+	<script type="text/javascript">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#${namespace}mainForm input[type=email],input[type=tel],input[type=text],select').on('blur change', function(event) {
+				$(event.target).parent().children('span').remove();
+				if ($.trim(event.target.value) == 0) {
+					$('<span>').attr(
+						'class', 'portlet-msg-error').text(
+							'${valueIsRequired}').appendTo(
+								$(event.target).parent());
+				}
+			});
+			$('#${namespace}dateOfBirth').datepicker({dateFormat:'${jQueryDatePattern}'});
+			$('#${namespace}hideComments').click(function(){
+				$('#${namespace}comments').hide();
+				$('#${namespace}hideComments').hide();
+				$('#${namespace}showComments').show();
+			});
+			$('#${namespace}showComments').click(function(){
+				$('#${namespace}comments').show();
+				$('#${namespace}hideComments').show();
+				$('#${namespace}showComments').hide();
+			});
+		});
+		/*]]>*/
+	</script>
+	<div class="container">
+		<div class="row">
+			<div class="col-6">
+				<portlet:actionURL var="mainFormActionURL"/>
+				<form id="${namespace}mainForm" action="${mainFormActionURL}" method="post">
+					<c:if test="${not empty globalInfoMessage}">
+						<span class="portlet-msg-info">${globalInfoMessage}</span>
+					</c:if>
+					<c:if test="${not empty globalErrorMessage}">
+						<span class="portlet-msg-error">${globalErrorMessage}</span>
+					</c:if>
+					<fieldset>
+						<div class="row">
+							<div class="col-6">
+								<div class="form-group">
+									<label for="${namespace}firstName">
+										<fmt:message bundle="${i18n}" key="first-name" />
+									</label>
+									<input id="${namespace}firstName" class="form-control" name="${namespace}firstName" type="text" value="${applicant.firstName}"/>
+									<c:if test="${fields.hasErrors('firstName')}">
+										<span class="portlet-msg-error">${fields.error('firstName')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}lastName">
+										<fmt:message bundle="${i18n}" key="last-name" />
+									</label>
+									<input id="${namespace}lastName" class="form-control" name="${namespace}lastName" type="text" value="${applicant.lastName}"/>
+									<c:if test="${fields.hasErrors('lastName')}">
+										<span class="portlet-msg-error">${fields.error('lastName')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}emailAddress">
+										<fmt:message bundle="${i18n}" key="email-address" />
+									</label>
+									<input id="${namespace}emailAddress" class="form-control" name="${namespace}emailAddress" type="email" value="${applicant.emailAddress}"/>
+									<c:if test="${fields.hasErrors('emailAddress')}">
+										<span class="portlet-msg-error">${fields.error('emailAddress')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}phoneNumber">
+										<fmt:message bundle="${i18n}" key="phone-number" />
+									</label>
+									<input id="${namespace}phoneNumber" class="form-control" name="${namespace}phoneNumber" type="tel" value="${applicant.phoneNumber}"/>
+									<c:if test="${fields.hasErrors('phoneNumber')}">
+										<span class="portlet-msg-error">${fields.error('phoneNumber')}</span>
+									</c:if>
+								</div>
+							</div>
+							<div class="col-6">
+								<div class="form-group">
+									<label for="${namespace}dateOfBirth">
+										<fmt:message bundle="${i18n}" key="date-of-birth" />
+									</label>
+									<input id="${namespace}dateOfBirth" class="form-control" name="${namespace}dateOfBirth" type="text" value="${converter.convert('applicant.dateOfBirth')}"/>
+									<c:if test="${fields.hasErrors('dateOfBirth')}">
+										<span class="portlet-msg-error">${fields.error('dateOfBirth')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}city">
+										<fmt:message bundle="${i18n}" key="city" />
+									</label>
+									<input id="${namespace}city" class="form-control" name="${namespace}city" type="text" value="${applicant.city}"/>
+									<c:if test="${fields.hasErrors('city')}">
+										<span class="portlet-msg-error">${fields.error('city')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}provinceId">
+										<fmt:message bundle="${i18n}" key="state-province" />
+									</label>
+									<fmt:message bundle="${i18n}" key="select" var="select" />
+									<select id="${namespace}provinceId" class="form-control" name="${namespace}provinceId" value="${applicant.provinceId}">
+										<option value="">${select}</option>
+										<c:forEach items="${provinces}" var="province">
+											<c:choose>
+												<c:when test="${applicant.provinceId == province.provinceId}">
+													<option selected="selected" value="${province.provinceId}">${province.provinceName}</option>
+												</c:when>
+												<c:otherwise>
+													<option value="${province.provinceId}">${province.provinceName}</option>
+												</c:otherwise>
+											</c:choose>
+										</c:forEach>
+									</select>
+									<fmt:message bundle="${i18n}" key="postal-code-hint" var="postalCodeHint" />
+									<c:if test="${fields.hasErrors('provinceId')}">
+										<span class="portlet-msg-error">${fields.error('provinceId')}</span>
+									</c:if>
+								</div>
+								<div class="form-group">
+									<label for="${namespace}postalCode">
+										<fmt:message bundle="${i18n}" key="zip-postal" />
+									</label>
+									<input id="${namespace}postalCode" class="form-control" name="${namespace}postalCode" type="text" value="${applicant.postalCode}"/>
+									<img src="${contextPath}/images/icon-help.png" title="${postalCodeHint}"/>
+									<c:if test="${fields.hasErrors('postalCode')}">
+										<span class="portlet-msg-error">${fields.error('postalCode')}</span>
+									</c:if>
+								</div>
+							</div>
+						</div>
+					</fieldset>
+					<fieldset>
+						<div class="row">
+							<div class="col">
+								<div class="form-group">
+									<label for="${namespace}comments">
+										<fmt:message bundle="${i18n}" key="comments" />
+									</label>
+									<div>
+										<a id="${namespace}hideComments" href="javascript:;"><fmt:message bundle="${i18n}" key="hide"/></a>
+									</div>
+									<div>
+										<a id="${namespace}showComments" href="javascript:;" style="display:none;"><fmt:message bundle="${i18n}" key="show"/></a>
+									</div>
+									<textarea id="${namespace}comments" class="form-control" name="${namespace}comments">${applicant.comments}</textarea>
+								</div>
+							</div>
+						</div>
+					</fieldset>
+					<input name="${mvc.csrf.name}" value="${mvc.csrf.token}" type="hidden"/>
+					<input name="${namespace}javax.portlet.action" value="submitApplicant" type="hidden"/>
+					<fmt:message bundle="${i18n}" key="submit" var="submit" />
+					<input class="btn btn-primary" value="${submit}" type="submit"/>
+				</form>
+			</div>
+			<div class="col-6">
+				<div class="row">
+					<div class="col">
+						<form id="${namespace}deleteFileForm" method="post" action="${deleteFileResourceURL}">
+							<h3><fmt:message bundle="${i18n}" key="attachments"/></h3>
+							<table class="table">
+								<thead>
+								<tr>
+									<th><img src="${contextPath}/images/icon-delete.png" style="display:none;"/></th>
+									<th><fmt:message bundle="${i18n}" key="file-name"/></th>
+									<th><fmt:message bundle="${i18n}" key="size"/></th>
+								</tr>
+								</thead>
+								<tbody id="${namespace}attachmentsTableBody">
+								<c:forEach items="${applicant.attachments}" var="attachment" varStatus="attachmentStatus">
+									<tr>
+										<td>
+											<input name="attachmentIndex" src="${contextPath}/images/icon-delete.png" value="${attachmentStatus.index}" type="image"/>
+										</td>
+										<td>
+											<c:out value="${attachment.name}"/>
+										</td>
+										<td>
+											<c:out value="${attachment.size}"/>
+										</td>
+									</tr>
+								</c:forEach>
+								</tbody>
+							</table>
+						</form>
+						<hr/>
+						<form id="${namespace}fileUploadForm" enctype="multipart/form-data">
+							<div class="form-group">
+								<input id="${namespace}inputFile" class="form-control" name="${namespace}multipartFiles" multiple="multiple" type="file"/>
+								<input name="${mvc.csrf.name}" value="${mvc.csrf.token}" type="hidden"/>
+								<input class="btn btn-primary" value="${submit}" type="submit"/>
+							</div>
+						</form>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	<hr />
+	<ul>
+		<li>Weld ${weldVersion}</li>
+	</ul>
+	<portlet:resourceURL id="viewTerms" var="viewTermsResourceURL"/>
+	<a href="${viewTermsResourceURL}" style="float:right;line-height:0px;" target="_blank">
+		<fmt:message bundle="${i18n}" key="terms-of-service" />
+	</a>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/confirmation.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/confirmation.jspx
new file mode 100644
index 0000000..8712ba9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/confirmation.jspx
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  xmlns:portlet="http://xmlns.jcp.org/portlet_3_0"
+		  version="2.1">
+	<fmt:setBundle basename="content.portlet1" var="i18n" />
+	<p>
+		<fmt:message bundle="${i18n}" key="thank-you-for-applying-for-a-job-with-our-organization">
+			<fmt:param value="${applicant.firstName}" />
+		</fmt:message>
+	</p>
+	<p>
+		<portlet:renderURL var="submitAnotherRenderURL" />
+		<fmt:message bundle="${i18n}" key="submit-another-application" var="submitAnotherApplication" />
+		<form action="${submitAnotherRenderURL}" method="get">
+			<input class="btn btn-primary" value="${submitAnotherApplication}" type="submit" />
+		</form>
+	</p>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/help.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/help.jspx
new file mode 100644
index 0000000..ba33b71
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/help.jspx
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  version="2.1">
+	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
+	<fmt:setBundle basename="content.portlet1" var="i18n" />
+	<fmt:message bundle="${i18n}" key="portlet-help"/>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/preferences.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/preferences.jspx
new file mode 100644
index 0000000..35f43d9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/preferences.jspx
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
+		  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  xmlns:portlet="http://xmlns.jcp.org/portlet_3_0"
+		  version="2.1">
+	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
+	<fmt:setBundle basename="content.portlet1" var="i18n" />
+	<portlet:actionURL var="mainFormActionURL"/>
+	<form id="${namespace}mainForm" action="${mainFormActionURL}" data-senna-off="true" method="post">
+		<fieldset>
+			<div class="form-group">
+				<label for="${namespace}datePattern" path="datePattern">
+					<fmt:message bundle="${i18n}" key="date-format" />
+				</label>
+				<input id="${namespace}datePattern" class="form-control" name="${namespace}datePattern" value="${preferences.datePattern}"/>
+				<c:if test="${fields.hasErrors('datePattern')}">
+					<span class="portlet-msg-error">${fields.error('datePattern')}</span>
+				</c:if>
+			</div>
+		</fieldset>
+		<hr />
+		<input name="${mvc.csrf.name}" value="${mvc.csrf.token}" type="hidden"/>
+		<button class="btn btn-primary" name="${namespace}javax.portlet.action" value="submitPreferences" type="submit">
+			<fmt:message bundle="${i18n}" key="submit" />
+		</button>
+		<button class="btn" name="${namespace}javax.portlet.action" value="reset" type="submit">
+			<fmt:message bundle="${i18n}" key="reset" />
+		</button>
+	</form>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/terms.jspx b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/terms.jspx
new file mode 100644
index 0000000..2b327aa
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/WEB-INF/views/terms.jspx
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<jsp:root xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+		  xmlns:jsp="http://java.sun.com/JSP/Page"
+		  xmlns:portlet="http://xmlns.jcp.org/portlet_3_0" version="2.1">
+	<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
+	<fmt:setBundle basename="content.portlet1" var="i18n" />
+	<html>
+		<head>
+			<title><fmt:message bundle="${i18n}" key="terms-of-service"/></title>
+		</head>
+		<body>
+			<h1>
+				<fmt:message bundle="${i18n}" key="terms-of-service"/>
+			</h1>
+			<p>
+				<ul>
+					<li><fmt:message bundle="${i18n}" key="terms-of-service-point1"/></li>
+					<li><fmt:message bundle="${i18n}" key="terms-of-service-point2"/></li>
+					<li><fmt:message bundle="${i18n}" key="terms-of-service-point3"/></li>
+				</ul>
+				<fmt:message bundle="${i18n}" key="accept" var="accept" />
+				<portlet:resourceURL id="acceptTerms" var="acceptTermsResourceURL"/>
+				<form action="${acceptTermsResourceURL}" method="post">
+					<input name="${mvc.csrf.name}" value="${mvc.csrf.token}" type="hidden"/>
+					<input class="btn btn-primary" value="${accept}" type="submit"/>
+				</form>
+			</p>
+			<p>
+				<span><fmt:message bundle="${i18n}" key="copyright"/></span>
+				<span> ${thisYear} </span>
+				<span><fmt:message bundle="${i18n}" key="all-rights-reserved"/></span>
+			</p>
+		</body>
+	</html>
+</jsp:root>
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-delete.png b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-delete.png
new file mode 100644
index 0000000..26c38fb
Binary files /dev/null and b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-delete.png differ
diff --git a/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-help.png b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-help.png
new file mode 100644
index 0000000..e581d4a
Binary files /dev/null and b/demo/applicant-mvcbean-cdi-jsp-portlet/src/main/webapp/images/icon-help.png differ
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/pom.xml b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/pom.xml
new file mode 100644
index 0000000..27d6e56
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/pom.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+   license agreements. See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership. The ASF licenses this file to
+   you under the Apache License, Version 2.0 (the "License"); you may not use
+   this file except in compliance with the License. You may obtain a copy of
+   the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+   by applicable law or agreed to in writing, software distributed under the
+   License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+   OF ANY KIND, either express or implied. See the License for the specific
+   language governing permissions and limitations under the License. -->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.portals.pluto</groupId>
+		<artifactId>demo</artifactId>
+		<version>3.0.2-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<packaging>war</packaging>
+	<artifactId>applicant-mvcbean-cdi-thymeleaf-portlet</artifactId>
+	<name>applicant-mvcbean-cdi-thymeleaf-portlet</name>
+	<description>Applicant - MVCBean CDI Portlet (Thymeleaf)</description>
+	<profiles>
+		<profile>
+			<id>liferay-cdi</id>
+			<build>
+				<finalName>${project.artifactId}</finalName>
+				<plugins>
+					<plugin>
+						<artifactId>maven-war-plugin</artifactId>
+						<configuration>
+							<failOnMissingWebXml>false</failOnMissingWebXml>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-validator</artifactId>
+					<exclusions>
+						<exclusion>
+							<groupId>javax.validation</groupId>
+							<artifactId>validation-api</artifactId>
+						</exclusion>
+					</exclusions>
+				</dependency>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-validator-cdi</artifactId>
+				</dependency>
+			</dependencies>
+		</profile>
+		<profile>
+		<id>pluto</id>
+			<build>
+				<finalName>${project.artifactId}</finalName>
+				<plugins>
+					<plugin>
+						<artifactId>maven-war-plugin</artifactId>
+						<configuration>
+							<failOnMissingWebXml>false</failOnMissingWebXml>
+							<packagingExcludes>
+								WEB-INF/liferay-display.xml,
+								WEB-INF/liferay-plugin-package.properties
+							</packagingExcludes>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+	<dependencies>
+		<dependency>
+			<groupId>javax.mvc</groupId>
+			<artifactId>javax.mvc-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.ws.rs</groupId>
+			<artifactId>javax.ws.rs-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.portlet</groupId>
+			<artifactId>portlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.validation</groupId>
+			<artifactId>validation-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.portals.pluto</groupId>
+			<artifactId>thymeleaf-mvc-portlet-cdi</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+		</dependency>
+	</dependencies>
+</project>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantActionController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantActionController.java
new file mode 100644
index 0000000..e0a8650
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantActionController.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.annotations.ActionMethod;
+import javax.portlet.annotations.PortletRequestScoped;
+import javax.validation.Valid;
+import javax.ws.rs.BeanParam;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Applicant;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Attachment;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Controller
+@PortletRequestScoped // Injection of the @Dependent pseudo-scoped @BeanPram Applicant requires this controller to be
+					  // @PortletRequestScoped instead of @ApplicationScoped.
+public class ApplicantActionController {
+
+	private static final Logger logger = LoggerFactory.getLogger(ApplicantActionController.class);
+
+	@Inject
+	@BeanParam
+	@Valid
+	private Applicant applicant;
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private BindingResult bindingResult;
+
+	@Inject
+	private Models models;
+
+	@ActionMethod(portletName = "portlet1", actionName = "submitApplicant")
+	@CsrfProtected
+	public String submitApplicant(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		models.put("applicant", applicant);
+
+		Set<ParamError> bindingErrors = bindingResult.getAllErrors();
+
+		if (bindingErrors.isEmpty()) {
+
+			PortletSession portletSession = actionRequest.getPortletSession();
+			List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+			if (logger.isDebugEnabled()) {
+				logger.debug("firstName=" + applicant.getFirstName());
+				logger.debug("lastName=" + applicant.getLastName());
+				logger.debug("emailAddress=" + applicant.getEmailAddress());
+				logger.debug("phoneNumber=" + applicant.getPhoneNumber());
+				logger.debug("dateOfBirth=" + applicant.getDateOfBirth());
+				logger.debug("city=" + applicant.getCity());
+				logger.debug("provinceId=" + applicant.getProvinceId());
+				logger.debug("postalCode=" + applicant.getPostalCode());
+				logger.debug("comments=" + applicant.getComments());
+			}
+
+			for (Attachment attachment : attachments) {
+
+				logger.debug("attachment=[{}]", attachment.getName());
+
+				File file = attachment.getFile();
+				file.delete();
+			}
+
+			return "redirect:confirmation.html";
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantRenderController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantRenderController.java
new file mode 100644
index 0000000..7172b19
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantRenderController.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.CDI;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.engine.ViewEngineContext;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceURL;
+import javax.portlet.annotations.RenderMethod;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Applicant;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Attachment;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class ApplicantRenderController {
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@Inject
+	private ProvinceService provinceService;
+
+	@Inject
+	private ViewEngineContext viewEngineContext;
+
+	@RenderMethod(portletNames = { "portlet1" })
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public String prepareView(RenderRequest renderRequest, RenderResponse renderResponse) {
+
+		String viewName = viewEngineContext.getView();
+
+		if (viewName == null) {
+
+			viewName = "applicant.html";
+
+			Applicant applicant = (Applicant) models.get("applicant");
+
+			if (applicant == null) {
+				applicant = new Applicant();
+				models.put("applicant", applicant);
+			}
+
+			PortletSession portletSession = renderRequest.getPortletSession();
+			List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+			applicant.setAttachments(attachments);
+
+			String datePattern = portletPreferences.getValue("datePattern", null);
+
+			models.put("jQueryDatePattern", _getJQueryDatePattern(datePattern));
+
+			models.put("provinces", provinceService.getAllProvinces());
+
+			CDI<Object> currentCDI = CDI.current();
+			BeanManager beanManager = currentCDI.getBeanManager();
+			Class<? extends BeanManager> beanManagerClass = beanManager.getClass();
+			Package beanManagerPackage = beanManagerClass.getPackage();
+			models.put("weldVersion", beanManagerPackage.getImplementationVersion());
+
+			// Thymeleaf
+			models.put("autoFillResourceURL", ControllerUtil.createResourceURL(renderResponse, "autoFill"));
+			models.put("deleteFileResourceURL", ControllerUtil.createResourceURL(renderResponse, "deleteFile"));
+			models.put("mainFormActionURL", renderResponse.createActionURL());
+			models.put("viewTermsResourceURL", ControllerUtil.createResourceURL(renderResponse, "viewTerms"));
+			models.put("uploadFilesResourceURL", ControllerUtil.createResourceURL(renderResponse, "uploadFiles"));
+		}
+
+		return viewName;
+	}
+
+	private String _getJQueryDatePattern(String datePattern) {
+
+		String jQueryDatePattern = datePattern;
+
+		if (datePattern.contains("yyyy")) {
+			jQueryDatePattern = datePattern.replaceAll("yyyy", "yy");
+		}
+		else if (datePattern.contains("yy")) {
+			jQueryDatePattern = datePattern.replaceAll("yy", "y");
+		}
+
+		jQueryDatePattern = jQueryDatePattern.replaceAll("M", "m");
+
+		return jQueryDatePattern;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantResourceController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantResourceController.java
new file mode 100644
index 0000000..cbc0935
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ApplicantResourceController.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.PortletSession;
+import javax.portlet.ResourceParameters;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.annotations.ServeResourceMethod;
+import javax.servlet.http.Part;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Attachment;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.City;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.CityService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class ApplicantResourceController {
+
+	private static final Logger logger = LoggerFactory.getLogger(ApplicantResourceController.class);
+
+	@Inject
+	private AttachmentManager attachmentManager;
+
+	@Inject
+	private CityService cityService;
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "autoFill")
+	public void autoFill(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		String postalCode = resourceParameters.getValue(resourceResponse.getNamespace() + "postalCode");
+
+		if (postalCode != null) {
+
+			try {
+				City city = cityService.getCityByPostalCode(postalCode);
+
+				if (city != null) {
+
+					Writer writer = resourceResponse.getWriter();
+
+					writer.write("{");
+					writer.write("\"cityName\": \"");
+					writer.write(city.getCityName());
+					writer.write("\",");
+					writer.write("\"provinceId\": \"");
+					writer.write(String.valueOf(city.getProvinceId()));
+					writer.write("\"}");
+				}
+			}
+			catch (IOException e) {
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "deleteFile")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public void deleteFile(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		PortletSession portletSession = resourceRequest.getPortletSession();
+
+		List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		String attachmentIndex = resourceParameters.getValue(resourceResponse.getNamespace() + "attachmentIndex");
+
+		if (attachmentIndex != null) {
+			Attachment attachment = attachments.remove(Integer.valueOf(attachmentIndex).intValue());
+
+			try {
+				File file = attachment.getFile();
+				file.delete();
+				_writeTabularJSON(resourceResponse.getWriter(), attachments);
+			}
+			catch (IOException e) {
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = { "portlet1" }, resourceID = "uploadFiles")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	public void uploadFiles(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		PortletSession portletSession = resourceRequest.getPortletSession(true);
+		List<Attachment> attachments = attachmentManager.getAttachments(portletSession.getId());
+
+		try {
+			Collection<Part> transientMultipartFiles = resourceRequest.getParts();
+
+			if (!transientMultipartFiles.isEmpty()) {
+
+				File attachmentDir = attachmentManager.getAttachmentDir(portletSession.getId());
+
+				if (!attachmentDir.exists()) {
+					attachmentDir.mkdir();
+				}
+
+				for (Part transientMultipartFile : transientMultipartFiles) {
+
+					String submittedFileName = transientMultipartFile.getSubmittedFileName();
+
+					if (submittedFileName != null) {
+						File copiedFile = new File(attachmentDir, submittedFileName);
+
+						transientMultipartFile.write(copiedFile.getAbsolutePath());
+
+						attachments.add(new Attachment(copiedFile));
+					}
+				}
+
+				_writeTabularJSON(resourceResponse.getWriter(), attachments);
+			}
+		}
+		catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+	}
+
+	private void _writeTabularJSON(Writer writer, List<Attachment> attachments) {
+
+		try {
+
+			writer.write("[");
+
+			boolean first = true;
+
+			for (Attachment attachment : attachments) {
+
+				if (first) {
+					first = false;
+				}
+				else {
+					writer.write(",");
+				}
+
+				writer.write("{\"fileName\": \"");
+
+				writer.write(attachment.getName());
+				writer.write("\",\"size\":\"");
+				writer.write(String.valueOf(attachment.getSize()));
+				writer.write("\"}");
+			}
+
+			writer.write("]");
+		}
+		catch (IOException e) {
+			logger.error(e.getMessage(), e);
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/AttachmentManager.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/AttachmentManager.java
new file mode 100644
index 0000000..cdedbc4
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/AttachmentManager.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Attachment;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class AttachmentManager {
+
+	@Inject
+	private ServletContext servletContext;
+
+	public File getAttachmentDir(String sessionId) {
+
+		File tempDir = (File) servletContext.getAttribute(ServletContext.TEMPDIR);
+
+		return new File(tempDir, sessionId);
+	}
+
+	public List<Attachment> getAttachments(String sessionId) {
+		return getAttachments(getAttachmentDir(sessionId));
+	}
+
+	public List<Attachment> getAttachments(File attachmentDir) {
+
+		List<Attachment> attachments = new ArrayList<>();
+
+		if (attachmentDir.exists()) {
+
+			File[] files = attachmentDir.listFiles();
+
+			for (File file : files) {
+				attachments.add(new Attachment(file));
+			}
+		}
+
+		return attachments;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ControllerUtil.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ControllerUtil.java
new file mode 100644
index 0000000..bd399c1
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/ControllerUtil.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import javax.portlet.MimeResponse;
+import javax.portlet.ResourceURL;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class ControllerUtil {
+
+	public static String createResourceURL(MimeResponse mimeResponse, String resourceID) {
+		ResourceURL resourceURL = mimeResponse.createResourceURL();
+		resourceURL.setResourceID(resourceID);
+
+		return resourceURL.toString();
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/HelpRenderController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/HelpRenderController.java
new file mode 100644
index 0000000..b96318e
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/HelpRenderController.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.mvc.Controller;
+import javax.mvc.View;
+import javax.portlet.annotations.RenderMethod;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class HelpRenderController {
+
+	@Controller
+	@RenderMethod(portletNames = { "portlet1" }, portletMode = "help")
+	@View("help.html")
+	public void renderHelpMode() {
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesActionController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesActionController.java
new file mode 100644
index 0000000..4043eef
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesActionController.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.util.Enumeration;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.WindowState;
+import javax.portlet.annotations.ActionMethod;
+import javax.portlet.annotations.PortletRequestScoped;
+import javax.validation.constraints.NotBlank;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+import javax.ws.rs.FormParam;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Preferences;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Controller
+@PortletRequestScoped // Injection of the @Dependent pseudo-scoped @FormParam String requires this controller to be
+					  // @PortletRequestScoped instead of @ApplicationScoped.
+@View("preferences.html")
+public class PreferencesActionController {
+
+	private static final Logger logger = LoggerFactory.getLogger(PreferencesActionController.class);
+
+	@Inject
+	private BindingResult bindingResult;
+
+	@Inject
+	@FormParam("datePattern")
+	@NotBlank
+	private String datePattern;
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletConfig portletConfig;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@ActionMethod(portletName = "portlet1", actionName = "reset")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	@CsrfProtected
+	public void resetPreferences(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		ResourceBundle resourceBundle = portletConfig.getResourceBundle(actionRequest.getLocale());
+
+		try {
+
+			Enumeration<String> preferenceNames = portletPreferences.getNames();
+
+			while (preferenceNames.hasMoreElements()) {
+				String preferenceName = preferenceNames.nextElement();
+
+				if (!portletPreferences.isReadOnly(preferenceName)) {
+					portletPreferences.reset(preferenceName);
+				}
+			}
+
+			portletPreferences.store();
+			actionResponse.setPortletMode(PortletMode.VIEW);
+			actionResponse.setWindowState(WindowState.NORMAL);
+			models.put("globalInfoMessage", resourceBundle.getString("your-request-processed-successfully"));
+		}
+		catch (Exception e) {
+
+			models.put("globalErrorMessage", resourceBundle.getString("an-unexpected-error-occurred"));
+
+			logger.error(e.getMessage(), e);
+		}
+	}
+
+	@ActionMethod(portletName = "portlet1", actionName = "submitPreferences")
+	@CsrfProtected
+	public void submitPreferences(ActionRequest actionRequest, ActionResponse actionResponse) {
+
+		ResourceBundle resourceBundle = portletConfig.getResourceBundle(actionRequest.getLocale());
+
+		models.put("preferences", new Preferences(datePattern));
+
+		Set<ParamError> bindingErrors = bindingResult.getAllErrors();
+
+		if (bindingErrors.isEmpty()) {
+
+			try {
+				portletPreferences.setValue("datePattern", datePattern);
+				portletPreferences.store();
+				actionResponse.setPortletMode(PortletMode.VIEW);
+				actionResponse.setWindowState(WindowState.NORMAL);
+				models.put("globalInfoMessage", resourceBundle.getString("your-request-processed-successfully"));
+			}
+			catch (Exception e) {
+				models.put("globalErrorMessage", resourceBundle.getString("an-unexpected-error-occurred"));
+				logger.error(e.getMessage(), e);
+			}
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesRenderController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesRenderController.java
new file mode 100644
index 0000000..d988948
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/PreferencesRenderController.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.portlet.PortletPreferences;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.annotations.RenderMethod;
+import javax.validation.executable.ExecutableType;
+import javax.validation.executable.ValidateOnExecution;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Preferences;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class PreferencesRenderController {
+
+	@Inject
+	private Models models;
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@RenderMethod(portletNames = { "portlet1" }, portletMode = "edit")
+	@ValidateOnExecution(type = ExecutableType.NONE)
+	@View("preferences.html")
+	public void prepareView(RenderRequest renderRequest, RenderResponse renderResponse) {
+
+		Map<String, Object> modelsMap = models.asMap();
+
+		if (!modelsMap.containsKey("preferences")) {
+			models.put("preferences", new Preferences(portletPreferences.getValue("datePattern", null)));
+		}
+
+		// Thymeleaf
+		models.put("mainFormActionURL", renderResponse.createActionURL());
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/TermsResourceController.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/TermsResourceController.java
new file mode 100644
index 0000000..e508dd9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/controller/TermsResourceController.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.controller;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.mvc.Controller;
+import javax.mvc.Models;
+import javax.mvc.View;
+import javax.mvc.security.CsrfProtected;
+import javax.portlet.MimeResponse;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceParameters;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceURL;
+import javax.portlet.annotations.ServeResourceMethod;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Controller
+public class TermsResourceController {
+
+	private static final Logger logger = LoggerFactory.getLogger(TermsResourceController.class);
+
+	@Inject
+	private Models models;
+
+	@CsrfProtected
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "acceptTerms")
+	public String acceptTerms(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		models.put("viewTermsAgainResourceURL", ControllerUtil.createResourceURL(resourceResponse, "viewTermsAgain"));
+
+		return "redirect:acceptance.html";
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html")
+	public void redirectedView(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		ResourceParameters resourceParameters = resourceRequest.getResourceParameters();
+
+		logger.debug("redirectedView=[{}]", resourceParameters.getValue("redirectedView"));
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "viewTerms")
+	@View("terms.html")
+	public void viewTerms(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+
+		_populateViewTermsModel(resourceResponse);
+
+		models.put("acceptTermsResourceURL", ControllerUtil.createResourceURL(resourceResponse, "acceptTerms"));
+	}
+
+	@ServeResourceMethod(portletNames = "portlet1", contentType = "text/html", resourceID = "viewTermsAgain")
+	@View("redirect:terms.html")
+	public void viewTermsAgain(ResourceRequest resourceRequest, ResourceResponse resourceResponse) {
+		logger.debug("Redirecting to Terms of Service");
+
+		_populateViewTermsModel(resourceResponse);
+	}
+
+	private void _populateViewTermsModel(ResourceResponse resourceResponse) {
+
+		DateFormat dateFormat = new SimpleDateFormat("yyyy");
+
+		Calendar todayCalendar = Calendar.getInstance();
+
+		models.put("thisYear", dateFormat.format(todayCalendar.getTime()));
+
+		// Thymeleaf
+		models.put("acceptTermsResourceURL", ControllerUtil.createResourceURL(resourceResponse, "acceptTerms"));
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverter.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverter.java
new file mode 100644
index 0000000..9b861b5
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverter.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.convert;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.portlet.PortletPreferences;
+import javax.ws.rs.ext.ParamConverter;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class DateParamConverter implements ParamConverter<Date> {
+
+	private DateFormat dateFormat;
+
+	public DateParamConverter(PortletPreferences portletPreferences) {
+		this.dateFormat = new SimpleDateFormat(portletPreferences.getValue("datePattern", null));
+	}
+
+	@Override
+	public Date fromString(String value) {
+
+		try {
+			return dateFormat.parse(value);
+		}
+		catch (ParseException e) {
+			throw new IllegalArgumentException(e);
+		}
+	}
+
+	@Override
+	public String toString(Date date) {
+		return dateFormat.format(date);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverterProvider.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverterProvider.java
new file mode 100644
index 0000000..8943b2b
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/convert/DateParamConverterProvider.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.convert;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Date;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.portlet.PortletPreferences;
+import javax.ws.rs.ext.ParamConverter;
+import javax.ws.rs.ext.ParamConverterProvider;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class DateParamConverterProvider implements ParamConverterProvider {
+
+	@Inject
+	protected PortletPreferences portletPreferences;
+
+	@Override
+	public <T> ParamConverter<T> getConverter(Class<T> rawType, Type baseType, Annotation[] annotations) {
+
+		if (rawType == null) {
+			return null;
+		}
+
+		if (rawType.equals(Date.class)) {
+			return (ParamConverter<T>) new DateParamConverter(portletPreferences);
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Applicant.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Applicant.java
new file mode 100644
index 0000000..c47eb7c
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Applicant.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+import javax.enterprise.context.Dependent;
+import javax.inject.Inject;
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Past;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.ws.rs.FormParam;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Dependent
+public class Applicant implements Serializable {
+
+	private static final long serialVersionUID = 2774594923346476261L;
+
+	private List<Attachment> attachments;
+
+	@Inject
+	@FormParam("city")
+	@NotBlank
+	private String city;
+
+	private String comments;
+
+	@Inject
+	@FormParam("dateOfBirth")
+	@NotNull
+	@Past
+	private Date dateOfBirth;
+
+	@Inject
+	@FormParam("emailAddress")
+	@Email
+	@NotBlank
+	private String emailAddress;
+
+	@Inject
+	@FormParam("firstName")
+	@NotBlank
+	private String firstName;
+
+	@Inject
+	@FormParam("lastName")
+	@NotBlank
+	private String lastName;
+
+	@Inject
+	@FormParam("phoneNumber")
+	@NotBlank
+	@Pattern(regexp = "([0-9]+)")
+	private String phoneNumber;
+
+	@Inject
+	@FormParam("postalCode")
+	@NotBlank
+	private String postalCode;
+
+	@Inject
+	@FormParam("provinceId")
+	@NotNull
+	@Positive
+	private Long provinceId;
+
+	public Applicant() {
+
+		Calendar calendar = new GregorianCalendar();
+		this.dateOfBirth = calendar.getTime();
+	}
+
+	public List<Attachment> getAttachments() {
+		return attachments;
+	}
+
+	public String getCity() {
+		return city;
+	}
+
+	public String getComments() {
+		return comments;
+	}
+
+	public Date getDateOfBirth() {
+		return dateOfBirth;
+	}
+
+	public String getEmailAddress() {
+		return emailAddress;
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public String getPhoneNumber() {
+		return phoneNumber;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public Long getProvinceId() {
+		return provinceId;
+	}
+
+	public void setAttachments(List<Attachment> attachments) {
+		this.attachments = attachments;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public void setComments(String comments) {
+		this.comments = comments;
+	}
+
+	public void setDateOfBirth(Date dateOfBirth) {
+		this.dateOfBirth = dateOfBirth;
+	}
+
+	public void setEmailAddress(String emailAddress) {
+		this.emailAddress = emailAddress;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public void setPhoneNumber(String phoneNumber) {
+		this.phoneNumber = phoneNumber;
+	}
+
+	public void setPostalCode(String postalCode) {
+		this.postalCode = postalCode;
+	}
+
+	public void setProvinceId(Long provinceId) {
+		this.provinceId = provinceId;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Attachment.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Attachment.java
new file mode 100644
index 0000000..ae10bf9
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Attachment.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto;
+
+import java.io.File;
+import java.io.Serializable;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class Attachment implements Serializable {
+
+	private static final long serialVersionUID = 1572382923498234661L;
+
+	private final File file;
+
+	public Attachment(File file) {
+		this.file = file;
+	}
+
+	public File getFile() {
+		return file;
+	}
+
+	public String getName() {
+		return file.getName();
+	}
+
+	public long getSize() {
+		return file.length();
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/City.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/City.java
new file mode 100644
index 0000000..79afe5f
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/City.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto;
+
+import java.io.Serializable;
+
+
+/**
+ * This is a bean that represents a City and implements the Transfer Object (formerly known as ValueObject/VO) design
+ * pattern.
+ *
+ * @author  "Neil Griffin"
+ */
+public class City implements Serializable {
+
+	// serialVersionUID
+	private static final long serialVersionUID = 3312342177113327761L;
+
+	// JavaBean Properties
+	private final long cityId;
+	private final String cityName;
+	private final String postalCode;
+	private final long provinceId;
+
+	public City(long cityId, long provinceId, String cityName, String postalCode) {
+		this.cityId = cityId;
+		this.provinceId = provinceId;
+		this.cityName = cityName;
+		this.postalCode = postalCode;
+	}
+
+	public long getCityId() {
+		return cityId;
+	}
+
+	public String getCityName() {
+		return cityName;
+	}
+
+	public String getPostalCode() {
+		return postalCode;
+	}
+
+	public long getProvinceId() {
+		return provinceId;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Preferences.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Preferences.java
new file mode 100644
index 0000000..987494b
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Preferences.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto;
+
+import javax.validation.constraints.NotBlank;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public class Preferences {
+
+	@NotBlank
+	private String datePattern;
+
+	public Preferences() {
+	}
+
+	public Preferences(String datePattern) {
+		this.datePattern = datePattern;
+	}
+
+	public String getDatePattern() {
+		return datePattern;
+	}
+
+	public void setDatePattern(String datePattern) {
+		this.datePattern = datePattern;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Province.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Province.java
new file mode 100755
index 0000000..03c808a
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/dto/Province.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto;
+
+import java.io.Serializable;
+
+
+/**
+ * This is a bean that represents a Province and implements the Transfer Object (formerly known as ValueObject/VO)
+ * design pattern.
+ *
+ * @author  "Neil Griffin"
+ */
+public class Province implements Serializable {
+
+	// serialVersionUID
+	private static final long serialVersionUID = 2342374742262228819L;
+
+	// JavaBean Properties
+	private final long provinceId;
+	private final String provinceName;
+
+	public Province(long provinceId, String provinceName) {
+		this.provinceId = provinceId;
+		this.provinceName = provinceName;
+	}
+
+	public long getProvinceId() {
+		return provinceId;
+	}
+
+	public String getProvinceName() {
+		return provinceName;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Converter.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Converter.java
new file mode 100644
index 0000000..17abd26
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Converter.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.el;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.util.Date;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.mvc.Models;
+import javax.portlet.PortletPreferences;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.convert.DateParamConverter;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@Named
+public class Converter {
+
+	private static final Logger logger = LoggerFactory.getLogger(Converter.class);
+
+	@Inject
+	private PortletPreferences portletPreferences;
+
+	@Inject
+	private Models models;
+
+	public Object convert(String exp) {
+
+		if (exp == null) {
+			return null;
+		}
+
+		Expression expression = new Expression(exp);
+
+		Object base = models.get(expression.getBase());
+
+		if (base == null) {
+			return null;
+		}
+
+		Class<?> baseClass = base.getClass();
+
+		try {
+			PropertyDescriptor propertyDescriptor = new PropertyDescriptor(expression.getProperty(), baseClass);
+			Method readMethod = propertyDescriptor.getReadMethod();
+
+			Object invoke = readMethod.invoke(base);
+
+			if (invoke == null) {
+				return null;
+			}
+
+			DateParamConverter dateParamConverter = new DateParamConverter(portletPreferences);
+
+			return dateParamConverter.toString((Date) invoke);
+		}
+		catch (Exception e) {
+			logger.error(e.getMessage(), e);
+		}
+
+		return null;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Expression.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Expression.java
new file mode 100644
index 0000000..57c3bea
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Expression.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.el;
+
+/**
+ * @author  Neil Griffin
+ */
+class Expression {
+
+	private final String base;
+	private final String property;
+
+	public Expression(String expression) {
+
+		int pos = expression.indexOf(".");
+
+		if (pos < 0) {
+			base = null;
+			property = expression;
+		}
+		else {
+			base = expression.substring(0, pos);
+			property = expression.substring(pos + 1);
+		}
+	}
+
+	public String getBase() {
+		return base;
+	}
+
+	public String getProperty() {
+		return property;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Fields.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Fields.java
new file mode 100644
index 0000000..c004c72
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/el/Fields.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.el;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.mvc.binding.BindingResult;
+import javax.mvc.binding.ParamError;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@Named
+@ApplicationScoped
+public class Fields {
+
+	@Inject
+	private BindingResult bindingResult;
+
+	public String error(String field) {
+
+		StringBuilder sb = new StringBuilder();
+		Collection<String> errors = errors(field);
+
+		boolean first = true;
+
+		for (String error : errors) {
+
+			if (first) {
+				first = false;
+			}
+			else {
+				sb.append(" ");
+			}
+
+			sb.append(error);
+		}
+
+		return sb.toString();
+	}
+
+	public Collection<String> errors(String field) {
+
+		if (field == null) {
+			return null;
+		}
+
+		Set<String> errors = new LinkedHashSet<>();
+
+		Set<ParamError> bindingResultErrors = bindingResult.getErrors(field);
+
+		for (ParamError bindingResultError : bindingResultErrors) {
+			errors.add(bindingResultError.getMessage());
+		}
+
+		return errors;
+	}
+
+	public boolean hasErrors(String field) {
+
+		if (field == null) {
+			return false;
+		}
+
+		Set<ParamError> bindingResultErrors = bindingResult.getErrors(field);
+
+		return !bindingResultErrors.isEmpty();
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/event/MvcEventListener.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/event/MvcEventListener.java
new file mode 100644
index 0000000..02f7973
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/event/MvcEventListener.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.event;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.mvc.event.AfterControllerEvent;
+import javax.mvc.event.AfterProcessViewEvent;
+import javax.mvc.event.BeforeControllerEvent;
+import javax.mvc.event.BeforeProcessViewEvent;
+import javax.mvc.event.ControllerRedirectEvent;
+import javax.mvc.event.MvcEvent;
+import javax.ws.rs.container.ResourceInfo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class MvcEventListener {
+
+	private static final Logger logger = LoggerFactory.getLogger(MvcEventListener.class);
+
+	public void afterControllerEventListener(@Observes AfterControllerEvent afterControllerEvent) {
+		ResourceInfo resourceInfo = afterControllerEvent.getResourceInfo();
+
+		logger.debug("Observed AfterControllerEvent class=[{}], method=[{}]", resourceInfo.getResourceClass(),
+			resourceInfo.getResourceMethod());
+	}
+
+	public void afterProcessViewEventListener(@Observes AfterProcessViewEvent afterProcessViewEvent) {
+		logger.debug("Observed AfterProcesssViewEvent view=[{}]", afterProcessViewEvent.getView());
+	}
+
+	public void beforeControllerEventListener(@Observes BeforeControllerEvent beforeControllerEvent) {
+		ResourceInfo resourceInfo = beforeControllerEvent.getResourceInfo();
+
+		logger.debug("Observed BeforeControllerEvent class=[{}], method=[{}]", resourceInfo.getResourceClass(),
+			resourceInfo.getResourceMethod());
+	}
+
+	public void beforeProcessViewEventListener(@Observes BeforeProcessViewEvent beforeProcessViewEvent) {
+		logger.debug("Observed BeforeProcesssViewEvent view=[{}]", beforeProcessViewEvent.getView());
+	}
+
+	public void controllerRedirectEventListener(@Observes ControllerRedirectEvent controllerRedirectEvent) {
+		ResourceInfo resourceInfo = controllerRedirectEvent.getResourceInfo();
+
+		logger.debug("Observed ControllerRedirectEvent class=[{}], method=[{}] location=[{}]",
+			resourceInfo.getResourceClass(), resourceInfo.getResourceMethod(), controllerRedirectEvent.getLocation());
+	}
+
+	public void mvcEventListener(@Observes MvcEvent mvcEvent) {
+		logger.trace("Observed MvcEvent=[{}]", mvcEvent);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/ApplicantPortlet.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/ApplicantPortlet.java
new file mode 100644
index 0000000..654e178
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/ApplicantPortlet.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.portlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.portlet.HeaderPortlet;
+import javax.portlet.HeaderRequest;
+import javax.portlet.HeaderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.annotations.HeaderMethod;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.annotations.Preference;
+import javax.portlet.annotations.Supports;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+@PortletConfiguration(
+	portletName = "portlet1", prefs = { @Preference(name = "datePattern", values = { "MM/dd/yyyy" }) },
+	supports = { @Supports(portletModes = { "view", "edit", "help" }) }, resourceBundle = "content.portlet1"
+)
+public class ApplicantPortlet implements HeaderPortlet {
+
+	@Override
+	@HeaderMethod(portletNames = { "portlet1" })
+	public void renderHeaders(HeaderRequest headerRequest, HeaderResponse headerResponse) throws PortletException,
+		IOException {
+
+		boolean liferayDetected = PortletContainer.LIFERAY.isDetected(headerRequest);
+		boolean plutoDetected = PortletContainer.PLUTO.isDetected(headerRequest);
+
+		if (plutoDetected) {
+			headerResponse.addDependency("jQuery", "com.jquery", "1.12.1",
+				"<script src=\"https://code.jquery.com/jquery-1.12.4.js\"></script>");
+			headerResponse.addDependency("Bootstrap", "com.getbootstrap", "4.0.0",
+				"<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\" integrity=\"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm\" crossorigin=\"anonymous\">");
+
+			PrintWriter writer = headerResponse.getWriter();
+			writer.write(
+				"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"></meta>");
+		}
+
+		if (liferayDetected || plutoDetected) {
+			headerResponse.addDependency("jQueryUI", "com.jquery", "1.12.1",
+				"<script src=\"https://code.jquery.com/ui/1.12.1/jquery-ui.js\"></script>");
+			headerResponse.addDependency("jQueryUICSS", "com.jquery", "1.12.1",
+				"<link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">");
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/PortletContainer.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/PortletContainer.java
new file mode 100644
index 0000000..c9ceebf
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/portlet/PortletContainer.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.portlet;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.filter.PortletRequestWrapper;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public enum PortletContainer {
+
+	LIFERAY("com.liferay"), PLUTO("org.apache.pluto"), WEBSPHERE("com.ibm");
+
+	private final String fqcnPrefix;
+
+	PortletContainer(String fqcnPrefix) {
+		this.fqcnPrefix = fqcnPrefix;
+	}
+
+	public boolean isDetected(PortletRequest portletRequest) {
+
+		portletRequest = unwrapPortletRequest(portletRequest);
+
+		Class<? extends PortletRequest> portletRequestClass = portletRequest.getClass();
+
+		String portletRequestClassName = portletRequestClass.getName();
+
+		return portletRequestClassName.startsWith(fqcnPrefix);
+	}
+
+	private PortletRequest unwrapPortletRequest(PortletRequest portletRequest) {
+
+		if (portletRequest instanceof PortletRequestWrapper) {
+			PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest;
+
+			return unwrapPortletRequest(portletRequestWrapper.getRequest());
+		}
+
+		return portletRequest;
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/CityService.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/CityService.java
new file mode 100644
index 0000000..859679e
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/CityService.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.City;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public interface CityService {
+
+	public City getCityByPostalCode(String postalCode);
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/ProvinceService.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/ProvinceService.java
new file mode 100644
index 0000000..91b65ba
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/ProvinceService.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service;
+
+import java.util.List;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Province;
+
+
+/**
+ * @author  Neil Griffin
+ */
+public interface ProvinceService {
+
+	public List<Province> getAllProvinces();
+
+	public long getProvinceId(String provinceName);
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/CityServiceMockImpl.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/CityServiceMockImpl.java
new file mode 100644
index 0000000..bf1a774
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/CityServiceMockImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.mock;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.City;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.CityService;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class CityServiceMockImpl implements CityService {
+
+	@Inject
+	private ProvinceService provinceService;
+
+	// Private Data Members
+	private List<City> cities;
+
+	@Override
+	public City getCityByPostalCode(String postalCode) {
+
+		for (City city : cities) {
+
+			if (city.getPostalCode().equals(postalCode)) {
+				return city;
+			}
+		}
+
+		return null;
+	}
+
+	@PostConstruct
+	public void postConstruct() {
+
+		long cityId = 1;
+		cities = new ArrayList<>();
+
+		City city = new City(cityId++, provinceService.getProvinceId("DE"), "Wilmington", "19806");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("GA"), "Atlanta", "30329");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("FL"), "Orlando", "32801");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("MD"), "Baltimore", "21224");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NC"), "Charlotte", "28202");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NJ"), "Hoboken", "07030");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("NY"), "Albany", "12205");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("SC"), "Columbia", "29201");
+		cities.add(city);
+		city = new City(cityId++, provinceService.getProvinceId("VA"), "Roanoke", "24013");
+		cities.add(city);
+		cities = Collections.unmodifiableList(cities);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/ProvinceServiceMockImpl.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/ProvinceServiceMockImpl.java
new file mode 100644
index 0000000..9a42038
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/service/mock/ProvinceServiceMockImpl.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.mock;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.dto.Province;
+import com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.service.ProvinceService;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class ProvinceServiceMockImpl implements ProvinceService {
+
+	private List<Province> provinces;
+
+	@Override
+	public List<Province> getAllProvinces() {
+		return provinces;
+	}
+
+	@Override
+	public long getProvinceId(String provinceName) {
+		long provinceId = 0;
+		List<Province> provinces = getAllProvinces();
+
+		for (Province province : provinces) {
+
+			if (province.getProvinceName().equals(provinceName)) {
+				provinceId = province.getProvinceId();
+
+				break;
+			}
+		}
+
+		return provinceId;
+	}
+
+	@PostConstruct
+	public void postConstruct() {
+
+		long provinceId = 1;
+		provinces = new ArrayList<>();
+
+		Province province = new Province(provinceId++, "DE");
+		provinces.add(province);
+		province = new Province(provinceId++, "GA");
+		provinces.add(province);
+		province = new Province(provinceId++, "FL");
+		provinces.add(province);
+		province = new Province(provinceId++, "MD");
+		provinces.add(province);
+		province = new Province(provinceId++, "NC");
+		provinces.add(province);
+		province = new Province(provinceId++, "NJ");
+		provinces.add(province);
+		province = new Province(provinceId++, "NY");
+		provinces.add(province);
+		province = new Province(provinceId++, "SC");
+		provinces.add(province);
+		province = new Province(provinceId++, "VA");
+		provinces.add(province);
+		provinces = Collections.unmodifiableList(provinces);
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/servlet/AttachmentSessionListener.java b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/servlet/AttachmentSessionListener.java
new file mode 100644
index 0000000..fae0ea8
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/java/com/liferay/blade/samples/applicant/mvcbean/cdi/thymeleaf/servlet/AttachmentSessionListener.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf.servlet;
+
+import java.io.File;
+
+import javax.servlet.ServletContext;
+import javax.servlet.annotation.WebListener;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author  Neil Griffin
+ */
+@WebListener
+public class AttachmentSessionListener implements HttpSessionListener {
+
+	private static final Logger logger = LoggerFactory.getLogger(AttachmentSessionListener.class);
+
+	@Override
+	public void sessionCreated(HttpSessionEvent httpSessionEvent) {
+	}
+
+	@Override
+	public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
+
+		HttpSession httpSession = httpSessionEvent.getSession();
+		ServletContext servletContext = httpSession.getServletContext();
+		File tempDir = (File) servletContext.getAttribute(ServletContext.TEMPDIR);
+
+		File attachmentDir = new File(tempDir, httpSession.getId());
+
+		if (attachmentDir.exists()) {
+
+			File[] files = attachmentDir.listFiles();
+
+			for (File file : files) {
+
+				file.delete();
+
+				logger.debug("Deleted file: " + file.getAbsolutePath());
+			}
+		}
+	}
+}
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/ValidationMessages.properties b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/ValidationMessages.properties
new file mode 100644
index 0000000..b9d7d9c
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/ValidationMessages.properties
@@ -0,0 +1,25 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+# https://github.com/hibernate/hibernate-validator/blob/master/engine/src/main/resources/org/hibernate/validator/ValidationMessages.properties
+javax.validation.constraints.Email.message=Invalid e-mail address
+javax.validation.constraints.NotNull.message=Value is required
+javax.validation.constraints.NotBlank.message=Value is required
+javax.validation.constraints.Pattern.message=Invalid pattern
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/content/portlet1.properties b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/content/portlet1.properties
new file mode 100644
index 0000000..156de4e
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/content/portlet1.properties
@@ -0,0 +1,63 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+accept=Accept
+add-attachment=Add Attachment
+all-rights-reserved=All Rights Reserved.
+an-unexpected-error-occurred=An unexpected error occurred.
+are-you-sure-you-want-to-delete-this=Are you sure you want to delete this?
+attachments=Attachments
+back-to-terms-of-service=Back to Terms of Service
+city=City
+comments=Comments
+copyright=Copyright (C)
+date-format=Date Format
+date-of-birth=Date of Birth
+edit-preferences=Edit Preferences
+email-address=Email Address
+file-name=File Name
+first-name=First Name
+hide=Hide
+javax.portlet.display-name=Applicant MVCBean CDI Portlet (Thymeleaf)
+javax.portlet.keywords=Applicant MVCBean CDI Portlet (Thymeleaf)
+javax.portlet.short-title=Applicant MVCBean CDI Portlet (Thymeleaf)
+javax.portlet.title=Applicant MVCBean CDI Portlet (Thymeleaf)
+job-application=Job Application
+last-name=Last Name
+liferay-dot-com=liferay.com
+phone-number=Phone Number
+portlet-help=This portlet demonstrates an MVCBean CDI Portlet with Thymeleaf views.
+postal-code-hint=Type any of these ZIP codes: 19806, 30329, 32801, 21224, 28202, 07030, 12205, 29201, 24013
+reset=Reset
+select=Select
+show=Show
+size=Size
+state-province=State
+submit=Submit
+submit-another-application=Submit Another Application
+terms-of-service=Terms of Service
+terms-of-service-point1=By applying for a job with our organization, you are agreeing to our terms of service.
+terms-of-service-point2=We reserve the right to modify our terms of service at without prior notice. 
+terms-of-service-point3=Your email address will not be used for marketing purposes.
+thank-you-for-accepting-our-terms-of-service=Thank you for accepting our terms of service.
+thank-you-for-applying-for-a-job-with-our-organization=Thank you {0} for applying for a job with our organization. Your request has been sent to our human resources department.
+your-request-processed-successfully=Your request processed successfully.
+value-is-required=Value is required
+zip-postal=ZIP Code
\ No newline at end of file
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/log4j.properties b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/log4j.properties
new file mode 100644
index 0000000..b167cdf
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/resources/log4j.properties
@@ -0,0 +1,25 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed  under the  License is distributed on an "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+log4j.rootLogger=INFO, R 
+log4j.appender.R=org.apache.log4j.ConsoleAppender 
+log4j.appender.R.layout=org.apache.log4j.PatternLayout 
+log4j.appender.R.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}:%L] %m%n
+log4j.logger.com.liferay.blade.samples.applicant.mvcbean.cdi.thymeleaf=DEBUG
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/beans.xml b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 0000000..e15fcf2
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" bean-discovery-mode="all" version="1.2"
+	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
+	<!-- This file is necessary in order to inform CDI that scanning should occur for CDI annotations. -->
+</beans>
\ No newline at end of file
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-display.xml b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-display.xml
new file mode 100755
index 0000000..b438c06
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-display.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 7.1.0//EN" "http://www.liferay.com/dtd/liferay-display_7_1_0.dtd">
+
+<display>
+	<category name="category.sample">
+		<portlet id="portlet1" />
+	</category>
+</display>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties
new file mode 100644
index 0000000..3637e23
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/liferay-plugin-package.properties
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+author=Neil Griffin
+change-log=
+licenses=Apache License, Version 2.0
+liferay-versions=7.2.*
+long-description=
+module-group-id=liferay
+module-incremental-version=1
+name=applicant-mvcbean-cdi-thymeleaf
+page-url=https://portals.apache.org/pluto/
+short-description=
+tags=
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/acceptance.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/acceptance.html
new file mode 100644
index 0000000..dfee214
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/acceptance.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<html xmlns:th="http://www.thymeleaf.org">
+	<head>
+		<title th:text="#{terms-of-service}"/>
+	</head>
+	<body>
+		<p th:text="#{thank-you-for-accepting-our-terms-of-service}"/>
+		<a th:href="${viewTermsAgainResourceURL}" th:text="#{back-to-terms-of-service}"/>
+	</body>
+</html>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/applicant.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/applicant.html
new file mode 100644
index 0000000..533475a
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/applicant.html
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<div xmlns:th="http://www.thymeleaf.org">
+	<script type="text/javascript" th:inline="javascript">
+		/*<![CDATA[*/
+		var [(${namespace})]_updateAttachments = function(responseJSON) {
+			$('#[(${namespace})]attachmentsTableBody').empty();
+			$('#[(${namespace})]inputFile').val('');
+			$.each(responseJSON, function(i, item) {
+				$('<tr>').append(
+					$('<td>').append(
+						$('<input>').attr(
+							'type', 'image').attr(
+							'src',
+							'[(${contextPath})]/images/icon-delete.png').attr(
+							'name', 'attachmentIndex').attr('value', i)),
+					$('<td>').text(item.fileName),
+					$('<td>').text(item.size)
+				).appendTo('#[(${namespace})]attachmentsTableBody');
+			});
+		}
+		/*]]>*/
+	</script>
+	<script type="text/javascript" th:inline="javascript">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#[(${namespace})]postalCode').on('change', function submitXHR(){
+				$.ajax({
+					data: {
+						[(${mvc.csrf.name})]: '[(${mvc.csrf.token})]',
+						[(${namespace})]postalCode: $(this).val()
+					},
+					type: 'post',
+					url: '[(${autoFillResourceURL})]'
+				}).done(function(responseData) {
+					var responseJSON = JSON.parse(responseData);
+					$('#[(${namespace})]city').val(responseJSON['cityName']).change();
+					$('#[(${namespace})]provinceId').val(responseJSON['provinceId']).change();
+				}).fail(function() {
+					console.log('XHR failed');
+				});
+			});
+		});
+		/*]]>*/
+	</script>
+	<script type="text/javascript" th:inline="text">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#[(${namespace})]deleteFileForm').on('click', 'input', function (event) {
+				event.preventDefault();
+				if (confirm('[(#{are-you-sure-you-want-to-delete-this})]')) {
+					$.ajax({
+						data: {
+							[(${namespace})]attachmentIndex: event.target.value,
+							[(${mvc.csrf.name})]: '[(${mvc.csrf.token})]'
+						},
+						type: 'post',
+						url: '[(${deleteFileResourceURL})]'
+					}).done(function (responseData) {
+						[(${namespace})]_updateAttachments(JSON.parse(responseData));
+					}).fail(function () {
+						console.log('XHR failed');
+					});
+				}
+			});
+		});
+		/*]]>*/
+	</script>
+	<script type="text/javascript" th:inline="text">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#[(${namespace})]fileUploadForm').submit(function (event) {
+				event.preventDefault();
+				var formData = new FormData($(this)[0]);
+				$.ajax({
+					async: false,
+					cache: false,
+					contentType: false,
+					data: formData,
+					processData: false,
+					type: 'post',
+					url: '[(${uploadFilesResourceURL})]'
+				}).done(function(responseData) {
+					[(${namespace})]_updateAttachments(JSON.parse(responseData));
+				}).fail(function() {
+					console.log('XHR failed');
+				});
+			});
+		});
+		/*]]>*/
+	</script>
+	<script type="text/javascript" th:inline="text">
+		/*<![CDATA[*/
+		$(document).ready(function(){
+			$('#[(${namespace})]mainForm input[type=email],input[type=tel],input[type=text],select').on('blur change', function(event) {
+				$(event.target).parent().children('span').remove();
+				if ($.trim(event.target.value) == 0) {
+					$('<span>').attr(
+						'class', 'portlet-msg-error').text(
+						'[(#{value-is-required})]').appendTo(
+						$(event.target).parent());
+				}
+			});
+			$('#[(${namespace})]dateOfBirth').datepicker({dateFormat:'[(${jQueryDatePattern})]'});
+			$('#[(${namespace})]hideComments').click(function(){
+				$('#[(${namespace})]comments').hide();
+				$('#[(${namespace})]hideComments').hide();
+				$('#[(${namespace})]showComments').show();
+			});
+			$('#[(${namespace})]showComments').click(function(){
+				$('#[(${namespace})]comments').show();
+				$('#[(${namespace})]hideComments').show();
+				$('#[(${namespace})]showComments').hide();
+			});
+		});
+		/*]]>*/
+	</script>
+	<div class="container">
+		<div class="row">
+			<div class="col-6">
+				<form th:id="|${namespace}mainForm|" method="post" th:action="${mainFormActionURL}" th:object="${applicant}">
+					<span class="portlet-msg-info" th:if="${globalInfoMessage != null}" th:text="${globalInfoMessage}"/>
+					<span class="portlet-msg-error" th:if="${globalErrorMessage != null}" th:text="${globalErrorMessage}"/>
+					<fieldset>
+						<div class="row">
+							<div class="col-6">
+								<div class="form-group">
+									<label th:for="|${namespace}firstName|" th:text="#{first-name}"/>
+									<input th:id="|${namespace}firstName|" class="form-control" th:name="|${namespace}firstName|" type="text" th:value="*{firstName}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('firstName')}" th:text="${fields.error('firstName')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}lastName|" th:text="#{last-name}"/>
+									<input th:id="|${namespace}lastName|" class="form-control" th:name="|${namespace}lastName|" type="text" th:value="*{lastName}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('lastName')}" th:text="${fields.error('lastName')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}emailAddress|" th:text="#{email-address}"/>
+									<input th:id="|${namespace}emailAddress|" class="form-control" th:name="|${namespace}emailAddress|" type="email" th:value="*{emailAddress}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('emailAddress')}" th:text="${fields.error('emailAddress')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}phoneNumber|" th:text="#{phone-number}"/>
+									<input th:id="|${namespace}phoneNumber|" class="form-control" th:name="|${namespace}phoneNumber|" type="tel" th:value="*{phoneNumber}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('phoneNumber')}" th:text="${fields.error('phoneNumber')}"/>
+								</div>
+							</div>
+							<div class="col-6">
+								<div class="form-group">
+									<label th:for="|${namespace}dateOfBirth|" th:text="#{date-of-birth}"/>
+									<input th:id="|${namespace}dateOfBirth|" class="form-control" th:name="|${namespace}dateOfBirth|" type="text" th:value="${converter.convert('applicant.dateOfBirth')}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('dateOfBirth')}" th:text="${fields.error('dateOfBirth')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}city|" th:text="#{city}"/>
+									<input th:id="|${namespace}city|" class="form-control" th:name="|${namespace}city|" type="text" th:value="*{city}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('city')}" th:text="${fields.error('city')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}provinceId|" th:text="#{state-province}"/>
+									<select th:id="|${namespace}provinceId|" class="form-control" th:name="|${namespace}provinceId|" th:value="*{provinceId}">
+										<option th:text="#{select}" value=""/>
+										<option th:each="province: ${provinces}" th:text="${province.provinceName}" th:selected="(${province.provinceId} == *{provinceId})" th:value="${province.provinceId}"/>
+									</select>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('provinceId')}" th:text="${fields.error('provinceId')}"/>
+								</div>
+								<div class="form-group">
+									<label th:for="|${namespace}postalCode|" th:text="#{zip-postal}"/>
+									<input th:id="|${namespace}postalCode|" class="form-control" th:name="|${namespace}postalCode|" type="text" th:value="*{postalCode}"/>
+									<img th:src="|${contextPath}/images/icon-help.png|" th:title="#{postal-code-hint}"/>
+									<span class="portlet-msg-error" th:if="${fields.hasErrors('postalCode')}" th:text="${fields.error('postalCode')}"/>
+								</div>
+							</div>
+						</div>
+					</fieldset>
+					<fieldset>
+						<div class="row">
+							<div class="col">
+								<div class="form-group">
+									<label th:for="|${namespace}comments|" th:text="#{comments}"/>
+									<div>
+										<a th:id="|${namespace}hideComments|" href="javascript:;" th:text="#{hide}"/>
+									</div>
+									<div>
+										<a th:id="|${namespace}showComments|" href="javascript:;" style="display:none;" th:text="#{show}"/>
+									</div>
+									<textarea th:id="|${namespace}comments|" class="form-control" th:value="*{comments}"></textarea>
+								</div>
+							</div>
+						</div>
+					</fieldset>
+					<input th:name="|${mvc.csrf.name}|" th:value="|${mvc.csrf.token}|" type="hidden"/>
+					<input th:name="|${namespace}javax.portlet.action|" value="submitApplicant" type="hidden"/>
+					<input class="btn btn-primary" th:text="${submit}" type="submit"/>
+				</form>
+			</div>
+			<div class="col-6">
+				<div class="row">
+					<div class="col">
+						<form th:id="|${namespace}deleteFileForm|" method="post" th:action="${deleteFileResourceURL}" th:object="${applicant}">
+							<h3 th:text="#{attachments}"/>
+							<table class="table">
+								<thead>
+									<tr>
+										<th><img th:src="|${contextPath}/images/icon-delete.png|" style="display:none;"/></th>
+										<th th:text="#{file-name}"/>
+										<th th:text="#{size}"/>
+									</tr>
+								</thead>
+								<tbody th:id="|${namespace}attachmentsTableBody|">
+									<tr th:each="attachment,attachmentStatus: *{attachments}">
+										<td>
+											<input name="attachmentIndex" th:src="|${contextPath}/images/icon-delete.png|" th:value="${attachmentStatus.index}" type="image"/>
+										</td>
+										<td th:text="${attachment.name}"/>
+										<td th:text="${attachment.size}"/>
+									</tr>
+								</tbody>
+							</table>
+						</form>
+						<hr/>
+						<form th:id="|${namespace}fileUploadForm|" enctype="multipart/form-data">
+							<div class="form-group">
+								<input th:id="|${namespace}inputFile|" class="form-control" th:name="multipartFiles" multiple="multiple" type="file"/>
+								<input th:name="|${mvc.csrf.name}|" th:value="|${mvc.csrf.token}|" type="hidden"/>
+								<input class="btn btn-primary" th:value="#{submit}" type="submit"/>
+							</div>
+						</form>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	<hr />
+	<ul>
+		<li th:text="|Weld ${weldVersion}|"/>
+	</ul>
+	<a th:href="${viewTermsResourceURL}" style="float:right;line-height:0px;" target="_blank" th:text="#{terms-of-service}"/>
+</div>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/confirmation.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/confirmation.html
new file mode 100644
index 0000000..b29402a
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/confirmation.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<div xmlns:th="http://www.thymeleaf.org">
+	<p th:text="#{thank-you-for-applying-for-a-job-with-our-organization(${applicant.firstName})}"/>
+	<p>
+		<form action="#" th:action="${submitAnotherRenderURL}" method="get">
+			<input class="btn btn-primary" th:value="#{submit-another-application}" type="submit" />
+		</form>
+	</p>
+</div>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/help.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/help.html
new file mode 100644
index 0000000..337ca39
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/help.html
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<div xmlns:th="http://www.thymeleaf.org">
+	<p th:text="#{portlet-help}"/>
+</div>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/preferences.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/preferences.html
new file mode 100644
index 0000000..1a709a4
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/preferences.html
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<div xmlns:th="http://www.thymeleaf.org">
+	<form th:id="|${namespace}mainForm|" data-senna-off="true" method="post" th:action="${mainFormActionURL}" th:object="${preferences}">
+		<fieldset>
+			<div class="form-group">
+				<label th:for="|${namespace}datePattern|" path="datePattern" th:text="#{date-format}"/>
+				<input th:id="|${namespace}datePattern|" class="form-control" th:name="|${namespace}datePattern|" th:value="*{datePattern}"/>
+				<span class="portlet-msg-error" th:if="${fields.hasErrors('datePattern')}" th:text="${fields.error('datePattern')}"/>
+			</div>
+		</fieldset>
+		<hr />
+		<input th:name="|${mvc.csrf.name}|" th:value="|${mvc.csrf.token}|" type="hidden"/>
+		<button class="btn btn-primary" th:name="|${namespace}javax.portlet.action|" th:text="#{submit}" type="submit" value="submitPreferences"/>
+		<button class="btn" th:name="|${namespace}javax.portlet.action|" th:text="#{reset}" type="submit" value="reset"/>
+	</form>
+</div>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/terms.html b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/terms.html
new file mode 100644
index 0000000..c9ca7aa
--- /dev/null
+++ b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/WEB-INF/views/terms.html
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+*/-->
+<html xmlns:th="http://www.thymeleaf.org">
+	<head>
+		<title th:text="#{terms-of-service}"/>
+	</head>
+	<body>
+		<h1 th:text="#{terms-of-service}"/>
+		<p>
+			<ul>
+				<li th:text="#{terms-of-service-point1}"/>
+				<li th:text="#{terms-of-service-point2}"/>
+				<li th:text="#{terms-of-service-point3}"/>
+			</ul>
+			<form th:action="${acceptTermsResourceURL}" method="post">
+				<input th:name="${mvc.csrf.name}" th:value="${mvc.csrf.token}" type="hidden"/>
+				<input class="btn btn-primary" th:value="#{accept}" type="submit"/>
+			</form>
+		</p>
+		<p>
+			<span th:text="#{copyright}"/>
+			<span th:text="${thisYear}"/>
+			<span th:text="#{all-rights-reserved}"/>
+		</p>
+	</body>
+</html>
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-delete.png b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-delete.png
new file mode 100644
index 0000000..26c38fb
Binary files /dev/null and b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-delete.png differ
diff --git a/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-help.png b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-help.png
new file mode 100644
index 0000000..e581d4a
Binary files /dev/null and b/demo/applicant-mvcbean-cdi-thymeleaf-portlet/src/main/webapp/images/icon-help.png differ
diff --git a/demo/chat-room-demo-portlet/pom.xml b/demo/chat-room-demo-portlet/pom.xml
index 18ef9a3..fda7d37 100644
--- a/demo/chat-room-demo-portlet/pom.xml
+++ b/demo/chat-room-demo-portlet/pom.xml
@@ -76,46 +76,12 @@
       <plugins>
          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-compiler-plugin</artifactId>
-         </plugin>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-war-plugin</artifactId>
             <configuration>
                <archiveClasses>false</archiveClasses>
                <failOnMissingWebXml>false</failOnMissingWebXml>
             </configuration>
          </plugin>
-         
-         <!-- Don't attach source or javadoc archive (for release plugin)-->
-         <plugin>
-           <artifactId>maven-source-plugin</artifactId>
-           <configuration>
-             <attach>false</attach>
-           </configuration>
-         </plugin>
-         <plugin>
-           <artifactId>maven-javadoc-plugin</artifactId>
-           <configuration>
-             <skip>true</skip>
-           </configuration>
-         </plugin>
-          <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
-          <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-remote-resources-plugin</artifactId>
-              <executions>
-                  <execution>
-                      <goals>
-                          <goal>process</goal>
-                      </goals>
-                      <configuration>
-                          <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
-                          <attached>false</attached>
-                      </configuration>
-                  </execution>
-              </executions>
-          </plugin>
       </plugins>
    </build>
 
@@ -227,22 +193,6 @@
                    </packagingExcludes>
                  </configuration>
                </plugin>
-               <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
-               <plugin>
-                   <groupId>org.apache.maven.plugins</groupId>
-                   <artifactId>maven-remote-resources-plugin</artifactId>
-                   <executions>
-                       <execution>
-                           <goals>
-                               <goal>process</goal>
-                           </goals>
-                           <configuration>
-                               <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
-                               <attached>false</attached>
-                           </configuration>
-                       </execution>
-                   </executions>
-               </plugin>
             </plugins>
          </build>
 
diff --git a/demo/hub-demo-portlet/pom.xml b/demo/hub-demo-portlet/pom.xml
index 5816067..3936fb8 100644
--- a/demo/hub-demo-portlet/pom.xml
+++ b/demo/hub-demo-portlet/pom.xml
@@ -75,42 +75,6 @@
       </dependency>
    </dependencies>
 
-   <build>
-      <finalName>${project.artifactId}</finalName>
-      <plugins>
-         <!-- Don't attach source or javadoc archive (for release plugin)-->
-         <plugin>
-           <artifactId>maven-source-plugin</artifactId>
-           <configuration>
-             <attach>false</attach>
-           </configuration>
-         </plugin>
-         <plugin>
-           <artifactId>maven-javadoc-plugin</artifactId>
-           <configuration>
-             <skip>true</skip>
-           </configuration>
-         </plugin>
-
-         <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
-         <plugin>
-             <groupId>org.apache.maven.plugins</groupId>
-             <artifactId>maven-remote-resources-plugin</artifactId>
-             <executions>
-                 <execution>
-                     <goals>
-                         <goal>process</goal>
-                     </goals>
-                     <configuration>
-                         <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
-                         <attached>false</attached>
-                     </configuration>
-                 </execution>
-             </executions>
-         </plugin>
-      </plugins>
-   </build>
-
    <profiles>
        <profile>
            <id>liferay</id>
@@ -125,6 +89,7 @@
        <profile>
            <id>liferay-cdi</id>
            <build>
+               <finalName>${project.artifactId}</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
@@ -141,6 +106,7 @@
        <profile>
            <id>liferay-spring</id>
            <build>
+               <finalName>${project.artifactId}</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
@@ -215,6 +181,7 @@
             </dependency>
          </dependencies>
          <build>
+            <finalName>${project.artifactId}</finalName>
             <plugins>
                <plugin>
                  <artifactId>maven-war-plugin</artifactId>
diff --git a/demo/pom.xml b/demo/pom.xml
index a1382ab..eb6b8ab 100644
--- a/demo/pom.xml
+++ b/demo/pom.xml
@@ -23,10 +23,45 @@
 	<name>Demo Portlets</name>
 
 	<modules>
+		<module>applicant-mvcbean-cdi-jsp-portlet</module>
+		<module>applicant-mvcbean-cdi-thymeleaf-portlet</module>
 		<module>chat-room-demo-portlet</module>
         <module>hub-demo-portlet</module>
         <module>v3-demo-portlet</module>
         <module>v3-annotated-demo-portlet</module>
 	</modules>
 
+	<build>
+		<plugins>
+			<!-- Workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-remote-resources-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>process</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+							<attached>false</attached>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<!-- Don't attach source or javadoc archive (for release plugin) -->
+			<plugin>
+				<artifactId>maven-source-plugin</artifactId>
+				<configuration>
+					<attach>false</attach>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>
diff --git a/demo/v3-annotated-demo-portlet/pom.xml b/demo/v3-annotated-demo-portlet/pom.xml
index 6e26ead..3aa7eba 100644
--- a/demo/v3-annotated-demo-portlet/pom.xml
+++ b/demo/v3-annotated-demo-portlet/pom.xml
@@ -69,36 +69,6 @@
                <failOnMissingWebXml>false</failOnMissingWebXml>
             </configuration>
          </plugin>
-         
-         <!-- Don't attach source or javadoc archive (for release plugin)-->
-         <plugin>
-           <artifactId>maven-source-plugin</artifactId>
-           <configuration>
-             <attach>false</attach>
-           </configuration>
-         </plugin>
-         <plugin>
-           <artifactId>maven-javadoc-plugin</artifactId>
-           <configuration>
-             <skip>true</skip>
-           </configuration>
-         </plugin>
-         <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
-         <plugin>
-             <groupId>org.apache.maven.plugins</groupId>
-             <artifactId>maven-remote-resources-plugin</artifactId>
-             <executions>
-                 <execution>
-                     <goals>
-                         <goal>process</goal>
-                     </goals>
-                     <configuration>
-                         <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
-                         <attached>false</attached>
-                     </configuration>
-                 </execution>
-             </executions>
-         </plugin>
       </plugins>
    </build>
 
diff --git a/demo/v3-demo-portlet/pom.xml b/demo/v3-demo-portlet/pom.xml
index 7335be2..8a26810 100644
--- a/demo/v3-demo-portlet/pom.xml
+++ b/demo/v3-demo-portlet/pom.xml
@@ -84,36 +84,6 @@
                <failOnMissingWebXml>false</failOnMissingWebXml>
             </configuration>
          </plugin>
-         
-         <!-- Don't attach source or javadoc archive (for release plugin)-->
-         <plugin>
-           <artifactId>maven-source-plugin</artifactId>
-           <configuration>
-             <attach>false</attach>
-           </configuration>
-         </plugin>
-         <plugin>
-           <artifactId>maven-javadoc-plugin</artifactId>
-           <configuration>
-             <skip>true</skip>
-           </configuration>
-         </plugin>
-         <!-- workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under WEB-INF/classes/META-INF -->
-         <plugin>
-             <groupId>org.apache.maven.plugins</groupId>
-             <artifactId>maven-remote-resources-plugin</artifactId>
-             <executions>
-                 <execution>
-                     <goals>
-                         <goal>process</goal>
-                     </goals>
-                     <configuration>
-                         <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
-                         <attached>false</attached>
-                     </configuration>
-                 </execution>
-             </executions>
-         </plugin>
       </plugins>
    </build>
 
diff --git a/dist-build.xml b/dist-build.xml
index 144a262..b445628 100644
--- a/dist-build.xml
+++ b/dist-build.xml
@@ -126,6 +126,7 @@
    </target>
 
    <target name="include-demos" if="includeDemos">
+      <copy file="demo/applicant-mvcbean-cdi-jsp-portlet/target/applicant-mvcbean-cdi-jsp-portlet.war" todir="${dist.dir}/webapps" />
       <copy file="demo/chat-room-demo-portlet/target/chat-room-demo-portlet.war" todir="${dist.dir}/webapps" />
       <copy file="demo/hub-demo-portlet/target/hub-demo-portlet.war" todir="${dist.dir}/webapps" />
       <copy file="demo/v3-annotated-demo-portlet/target/v3-annotated-demo-portlet.war" todir="${dist.dir}/webapps" />
diff --git a/pluto-portal/src/main/resources/pluto-portal-driver-config.xml b/pluto-portal/src/main/resources/pluto-portal-driver-config.xml
index 1248333..77be57a 100644
--- a/pluto-portal/src/main/resources/pluto-portal-driver-config.xml
+++ b/pluto-portal/src/main/resources/pluto-portal-driver-config.xml
@@ -223,6 +223,9 @@ limitations under the License.
       <portlet context="/chat-room-demo-portlet" name="BeanPortletDemo"/>
       <portlet context="/chat-room-demo-portlet" name="BeanPortletDemo"/>
     </page>
+    <page name="Applicant MVCBean Demo" uri="/WEB-INF/themes/pluto-default-theme.jsp">
+      <portlet context="applicant-mvcbean-cdi-jsp-portlet" name="portlet1"/>
+    </page>
     ${includeDemosEnd}
   </render-config>