EL syntax error: Expression cannot start with binary operator

Posted by auser on Stack Overflow See other posts from Stack Overflow or by auser
Published on 2012-09-01T08:52:25Z Indexed on 2012/09/01 9:38 UTC
Read the original article Hit count: 925

Filed under:
|

Anyone have any creative ideas for how I can solve this warning?

EL syntax error: Expression cannot start with binary operator

caused by the following code:

String.format("#{myController.deleteItemById(%d)}", getId())

My code looked like this before:

"#{myController.deleteItemById(" + getId() + ")}"

but this caused eclipse to generate the following warning:

EL syntax error: String is not closed

UPDATE:

@ManagedBean(name = "myController")
@ViewScoped
public class MyController implements Serializable {

  private long id;
  private HtmlPanelGroup panel;

  public long getId() {return this.id; }

  private void getPanel() {

  /// bunch of code for programatically creating a form

    HtmlCommandButton deleteButton = new HtmlCommandButton();
    deleteButton.setId(id);
    deleteButton.setValue(value);
    deleteButton.setActionExpression(/* EL expression used here */);
   }
}

<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 
    <!-- some other elements removed for the sake of clarity -->      
    <h:body>
        <h:panelGroup binding="#{myController.panel}" />
    </h:body>
</html>

© Stack Overflow or respective owner

Related posts about java

Related posts about el