Bug 1305033 - Unable to complie jsp which contains lambda which uses implicit variables of jsp
Summary: Unable to complie jsp which contains lambda which uses implicit variables of jsp
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: jboss-set
QA Contact: Radim Hatlapatka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-05 11:56 UTC by Radim Hatlapatka
Modified: 2016-07-13 16:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-10 09:01:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-3261 0 Blocker Closed Unable to complie jsp which contains lambda which uses implicit variables of jsp 2016-07-13 16:37:00 UTC

Description Radim Hatlapatka 2016-02-05 11:56:24 UTC
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}

Comment 1 JBoss JIRA Server 2016-02-10 09:00:04 UTC
Radim Hatlapatka <rhatlapa> updated the status of jira JBEAP-3261 to Closed

Comment 2 Radim Hatlapatka 2016-02-10 09:01:51 UTC
This is actually not a bug in EAP. It is caused by Java not allowing to throw checked exceptions from lambda expressions.

Comment 3 JBoss JIRA Server 2016-02-23 14:34:12 UTC
Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Reopened

Comment 4 JBoss JIRA Server 2016-02-25 11:11:56 UTC
Radim Hatlapatka <rhatlapa> updated the status of jira JBEAP-3261 to Closed

Comment 5 JBoss JIRA Server 2016-02-25 11:26:39 UTC
Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Reopened

Comment 6 JBoss JIRA Server 2016-02-25 11:27:10 UTC
Carlo de Wolf <cdewolf> updated the status of jira JBEAP-3261 to Resolved

Comment 7 JBoss JIRA Server 2016-07-13 16:37:01 UTC
Jiri Pallich <jpallich> updated the status of jira JBEAP-3261 to Closed


Note You need to log in before you can comment on or make changes to this bug.