I am using intellij and gradle to build the war and tomcat to run the server.
Here is my build.gradle
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'war'
import org.apache.tools.ant.filters.ReplaceTokens
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
eclipse.classpath.downloadSources = true
eclipse.classpath.downloadJavadoc = true
war.archiveName "paths.war"
repositories {
maven { url 'https://repo.maven.apache.org/maven2/' }
flatDir(dirs: 'dep-lib')
}
dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.1.+'
providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.+'
// explicit, so that we don't get the jar file in the project
compile 'log4j:log4j:1.2.+'
compile 'org.apache.commons:commons-lang3:3.+'
compile 'commons-validator:commons-validator:1.4.+'
compile 'javax.servlet:jstl:1.2'
compile 'org.json:json:20140107'
testCompile 'junit:junit:5.+'
testCompile 'commons-io:commons-io:2.4'
testCompile group: 'org.springframework', name: 'spring-core', version: '4.2.6.RELEASE'
testCompile group: 'org.springframework', name: 'spring-test', version: '4.2.6.RELEASE'
}
task versionWebXml(type: Copy) {
println("Copy")
from('src/main/webapp/WEB-INF/') {
filter(ReplaceTokens, tokens: project.ext.properties)
include 'web.xml'
}
println("${buildDir}")
into "${buildDir}"
}
war {
println("WAR")
webInf {
setDuplicatesStrategy "EXCLUDE"
}
webXml = file("${buildDir}/web.xml")
}
task devDeploy(type: Copy) {
if (file("dev.properties").exists()) {
ext.devProps = new Properties()
devProps.load(new FileInputStream("dev.properties"))
from war.archivePath
into devProps['deployDir'] + "/webapps/"
}
}
war.dependsOn versionWebXml
war.dependsOn test
devDeploy.dependsOn war
I have the following code
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<body>
<c:set var="solution" value="${path}"/>
<% System.out.println(PageContext.REQUEST); %>
<c:if test="${true}">
IF TRUE
</c:if>
<c:choose>
<c:when test="${true}">
TRUE
</c:when>
<c:otherwise>
FALSE
</c:otherwise>
</c:choose>
</body>
The page, when rendered, does not evaluate any of the c:if or c:when
It only displays FALSE
I have no idea why it is not rendering correctly.
Any help?