9
Xerev
8y

Dear lord! Why is it so hard to get this to work! Anyone know if its even possible to run lambda expression on JSP? I made sure everything is running on Java JDK 8. BUT IT DOESN'T WORKKKKK. I keep getting "Lambda expressions are allowed only at source level 1.8 or above"

Comments
  • 4
    The JSPs are not compiled against the JDK you use to run the webapplication.

    The compilation details depends on the application server itself (for example Tomcat 7 use Jasper 2 and the JDT compiler, the same used in Eclipse)

    However my suggestion is: don't use java code on a jsp (by using scriptlet), because the are a real mess. Move all your java logic on a controller class (if you're using an MVC framework) and use the JSP only as a view.
  • 3
    @snakebyte I totally feel so stupid. I spent 12 hours trying to get it to work and using lambda expression on class instead of jsp didn't even occur to me.. Thanks man! I can sleep soundly tonight at least.
Add Comment