This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228029 - EL 3.0 issues in JSP
Summary: EL 3.0 issues in JSP
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Expression Language (show other bugs)
Version: 7.3.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Fousek
URL: http://java.net/jira/browse/GLASSFISH...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 10:16 UTC by Vladimir Riha
Modified: 2013-04-19 01:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-03-28 10:16:49 UTC
As discussed, I'll report it to GlassFish as well and add link here.


#1 lambda function

 ${v = (x,y)->x+y; v(1,2)}

is marked in editor as error, if I run the page following error is displayed in browser:

org.apache.jasper.JasperException: /index.jsp(16,10) PWC6296: The function v must be used with a prefix when a default namespace is not specified
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:81)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:204)
	at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1599)
	at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:166)

========================
#2 string concatenation

${"A"+"B"}

Server log shows msg:

java.lang.NumberFormatException: For input string: "A"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:441)
	at java.lang.Long.valueOf(Long.java:540)
	at com.sun.el.lang.ELArithmetic$LongDelegate.coerce(ELArithmetic.java:210)
	at com.sun.el.lang.ELArithmetic.coerce(ELArithmetic.java:378)
	at com.sun.el.lang.ELArithmetic.add(ELArithmetic.java:259)
...



=======================
#3 string concatenation II

${"A" cat "B"}

org.apache.jasper.JasperException: /index.jsp(16,9) PWC6038: "${"A" cat "B"}" contains invalid expression(s): javax.el.ELException: Error Parsing: ${"A" cat "B"}
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:81)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:188)
...

======================
#4 Static field

 ${T(pckg.Test).label}

it is marked in editor and also in browser/server log

org.apache.jasper.JasperException: /index.jsp(16,10) PWC6296: The function T must be used with a prefix when a default namespace is not specified
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:81)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:204)
	at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1599)
	at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:166)
...

====================
#5 Set & Map declaration

 ${v = {1,2}}

or

${v = {"one":1, "two":2, "three":3}}


it is marked in editor and also in browser/server log



org.apache.jasper.JasperException: /index.jsp(16,9) PWC6038: "${v = {1,2}" contains invalid expression(s): javax.el.ELException: Error Parsing: ${v = {1,2}
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:81)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:188)
	at org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:656)
	at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:760)
	at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:947)
...




Product Version: NetBeans IDE Dev (Build web-main-javaee7-189-on-20130327)
Java: 1.7.0_17; Java HotSpot(TM) Client VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b32
System: Linux version 3.2.0-39-generic-pae running on i386; UTF-8; en_US (nb)
GlassFish 4 b81
Comment 1 Vladimir Riha 2013-03-28 10:25:34 UTC
just for the record, in JSF #1 works, all others don't (but no error in editor is displayed)
Comment 2 Vladimir Riha 2013-03-28 10:32:20 UTC
reported to Glassfish

http://java.net/jira/browse/GLASSFISH-20092
Comment 3 Martin Fousek 2013-03-28 10:32:54 UTC
(In reply to comment #1)
> just for the record, in JSF #1 works, all others don't (but no error in editor
> is displayed)

Thanks a lot Lado for testing that. JSF doesn't show errors since it looks well
to ELParser and it corresponds to the EL specification. I suppose that the
latest EL build is not integrated in to GF yet (I entered issue for similar EL
usage which was closed that it works well in the latest dev build to them).

Thanks for the link.
Comment 4 Vladimir Riha 2013-03-28 10:43:01 UTC
Little follow up:

According to the latest draft, #2, #3 and #4 has changed and String concatenation is changed to 

${"A"+="B"}

which shows error in both JSP & JSF but it works fine when deployed.
Comment 5 Vladimir Riha 2013-04-04 07:21:15 UTC
Just update: Issue on GlassFish is marked as fixed (#1 and #5), but target build is #88 and last available I see on download page is #83, so I probably have to wait some time to verify it
Comment 6 Martin Fousek 2013-04-04 07:26:51 UTC
(In reply to comment #5)
> Just update: Issue on GlassFish is marked as fixed (#1 and #5), but target
> build is #88 and last available I see on download page is #83, so I probably
> have to wait some time to verify it

That's great that they fixed that quickly. I'm afraid that the issue will not disappear from the editor until we will bundle the newest binaries into the IDE. So once I'll update them it should fix also our troubles.
Comment 7 Martin Fousek 2013-04-16 09:01:45 UTC
To summarise this:
- cases Nr.2, 3, 4 were changed in the EL specification
- case Nr.5 I fixed in JSP Lexer now by web-main #038a634e9c6c
- remains case Nr.1
Comment 8 Martin Fousek 2013-04-16 11:51:08 UTC
I must include the latest custom trunk build to get it working. Probably changes were included into el-impl:b08.

Fixed by another jsp parser update in web-main #81704e839f36.
Comment 9 Vladimir Riha 2013-04-17 13:45:23 UTC
Thank you, no more issues in editor (GlassFish 4.0 b84 still throws exception on run, but as far as I understand, b88 is target version)


Product Version: NetBeans IDE Dev (Build web-main-javaee7-237-on-20130417)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-40-generic-pae running on i386; UTF-8; en_US (nb)
Comment 10 Quality Engineering 2013-04-18 02:19:52 UTC
Integrated into 'main-golden', will be available in build *201304172301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/038a634e9c6c
User: Martin Fousek <marfous@netbeans.org>
Log: #228029 - EL 3.0 issues in JSP - case Nr.5
Comment 11 Quality Engineering 2013-04-19 01:18:44 UTC
Integrated into 'releases', will be available in build *201304182201* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/038a634e9c6c
User: Martin Fousek <marfous@netbeans.org>
Log: #228029 - EL 3.0 issues in JSP - case Nr.5