Glassfish JSP compiler version change

I pre-compile my JSP pages when deploying, but keep getting this error:

 Caused by: org.glassfish.deployment.common.DeploymentException: JSP
 Compilation Error: org.apache.jasper.JasperException: PWC6033: Error
 in Javac compilation for JSP

 PWC6199: Generated servlet error: diamond operator is not supported in
-source 1.5   (use -source 7 or higher to enable diamond operator

      

Does anyone know how to change the compiler version and / or options to fix this problem? I have already instructed that in order to use JDK7 as java,

asadmin set "server.java-config.java-home=/usr/java/jdk1.7.0_09"

      

But that doesn't work either.

+3


source to share


3 answers


Pre-create the JSP page using Maven or Ant by connecting ie jspc-maven-plugin . Not only do you gain the benefit of debugging in build phase and phase, but you also get deployment speed and eliminate frustration.



+2


source


To do this, you need to set the properties compilerSourceVM

and correctly compilerTargetVM

jsp-config

. See more details .



+6


source


Aravind's answer just skips an example. This is my working file WEB-INF\glassfish-web.xml

:

<glassfish-web-app>
   <jsp-config>
     <property name="compilerSourceVM" value="8" />
     <property name="compilerTargetVM" value="8" />
   </jsp-config>
</glassfish-web-app>

      

I am putting this file at war.

0


source







All Articles