jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
68 stars 49 forks source link

Object expression getting coerced to String incorrectly #28

Closed glassfishrobot closed 12 years ago

glassfishrobot commented 12 years ago

I'll attach the test war, but here are the details. Consider this page:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

Where the bean and getter are like this: package com.sun.faces.component; import javax.faces.application.Application; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.component.UICommand; import javax.faces.context.FacesContext; @ManagedBean(name="viewScopedBean") @ViewScoped public class ViewScopedComponentBindingBean { private UICommand button = null; public UICommand getCommandButton () { if (null == button) { FacesContext context = FacesContext.getCurrentInstance(); Application app = context.getApplication(); button = (UICommand) app.createComponent(context, "javax.faces.Command", "javax.faces.Button"); } return button; } } For some reason, the button is getting coerced into a String in AstCompositeExpression.getValue(): public Object getValue(EvaluationContext ctx) throws ELException { StringBuffer sb = new StringBuffer(16); Object obj = null; if (this.children != null) { for (int i = 0; i < this.children.length; i++) { obj = this.children[i].getValue(ctx); if (obj != null) { sb.append(obj); } } } return sb.toString(); } } I don't even know why AstCompositeExpression is getting into the picture, the expression does not appear to be a composite expression.
glassfishrobot commented 6 years ago
glassfishrobot commented 12 years ago

@glassfishrobot Commented Reported by @edburns

glassfishrobot commented 12 years ago

@glassfishrobot Commented @edburns said: Deploy this war to GlassFish 3.1.2 or GlassFish 3.1.1 and visit

http://127.0.0.1:8080/jsf-systest/faces/component03.jsp

You'll see the exception mentioned in the issue summary.

glassfishrobot commented 12 years ago

@glassfishrobot Commented @edburns said: There was an errant whitespace in the JSP. The bug is invalid.

glassfishrobot commented 12 years ago

@glassfishrobot Commented File: jsf-systest.war Attached By: @edburns

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA UEL-28

glassfishrobot commented 12 years ago

@glassfishrobot Commented Marked as invalid on Tuesday, January 24th 2012, 1:30:28 pm