On 4/8/2016 7:43 AM, Lyallex wrote:
On 8 April 2016 at 12:31, Violeta Georgieva <miles...@gmail.com> wrote:
Hi,
2016-04-08 14:28 GMT+03:00 Lyallex <lyal...@gmail.com>:
Apache Tomcat 7.0.42 running under jsvc against jdk1.7.0.45
on 64 bit Ubuntu Linux 12.10 built and deployed with Ant in Eclipse
JUNO set to 1.7 compliance
Please don't moan at me for using JSP scriptlets, I'm just doing some
throwaway prototyping so save the bandwidth. Thank You
I have been switching on Strings in 1.7 projects for a while now, I
use it in application classes running on the above with no problems at
all.
This morning I tried switching on Strings in jsp and got the following
compiler error
org.apache.jasper.JasperException Unable to compile class for JSP
etc etc
Cannot switch on a value of type String for source level below 1.7 ...
Hmm, interesting
Configured Jasper to compile against 1.7 and it all worked fine
It seems a little strange that running Tomcat against 1.7 wouldn't
automatically configure Jasper to compile against 1.7 ... doesn't it ?
Or does it?
I'm sure there is a good reason, I just can't think of it :-(
This behavior is correct. Check this
http://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html
compilerSourceVM - What JDK version are the source files compatible with?
(Default value: 1.6)
compilerTargetVM - What JDK version are the generated files compatible
with? (Default value: 1.6)
Regards,
Violeta
Well I'm sure it is ... but you miss the point entirely I'm afraid
I'll try again
I said
" It seems a little strange that running Tomcat against 1.7 wouldn't
automatically configure Jasper to compile against 1.7 ... doesn't it"
I'm not sure how you interpret this statement as an assertion that
the behavior is incorrect.
Once again.
Why is it that when Tomcat is run against Java 1.7 and obviously
interprets classes
written in 1.7 correctly Jasper isn't configure to compile at 1.7
compliance level.
It's just a question, I found it interesting.
And the answer, if I interpret Violeta's response correctly, is that it
will compile for Java 6 unless you *explicitly* tell it to use something
else. It won't know you want to use 7 unless you say so.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org