| Summary: | Unable to complie jsp which contains lambda which uses implicit variables of jsp | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Radim Hatlapatka <rhatlapa> |
| Component: | Web | Assignee: | jboss-set |
| Status: | CLOSED NOTABUG | QA Contact: | Radim Hatlapatka <rhatlapa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4.5 | CC: | rmaucher |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-02-10 09:01:51 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Radim Hatlapatka <rhatlapa> updated the status of jira JBEAP-3261 to Closed This is actually not a bug in EAP. It is caused by Java not allowing to throw checked exceptions from lambda expressions. Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Reopened Radim Hatlapatka <rhatlapa> updated the status of jira JBEAP-3261 to Closed Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Reopened Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Resolved Jiri Pallich <jpallich> updated the status of jira JBEAP-3261 to Closed |
Having jsp, which uses implicit jsp variable, such as {{out}} in lambda expression \[1\] fails to compile, see \[2\]. Using instead of lambda's forEach standard for cycle works without issues. [1] test.jsp using lambda with implicit variable {code} <%@ page language="java" pageEncoding="UTF-8" contentType="text/plain;charset=utf-8"%> <% String[] names = {"Joe", "Doe", "John", "Peter"}; java.util.List<String> namesAsList = java.util.Arrays.asList(names); namesAsList.forEach(out::println); for (String name : namesAsList) { out.println(name); } %> {code} [2] {noformat} JBWEB004060: An error occurred at line: 5 in the jsp file: /jsp-with-lambdas-implicit-variables.jsp Unhandled exception type IOException 2: <% 3: String[] names = {"Joe", "Doe", "John", "Peter"}; 4: java.util.List<String> namesAsList = java.util.Arrays.asList(names); 5: namesAsList.forEach(out::println); Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:95) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:449) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:359) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:652) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat}