Wednesday 15 February 2012

jsf - Something missing in the Expression Language (EL) syntax for calling a function in a Java class -


I used (EL) myUnmanagedBean.fn () to calculate the text for it Have a link label from a Java class. Where myUnmanagedBean is the name of Bean.

is the function,

  private static string s = "vijay"; Static String FN () {Returns S; }   

I have added data reference for an expand and the associated code is:

    

The error page shows:

  Exception: myUnmanagedBean.fn () "" (", expected" ["}", ".", " "", "Gt", "<", "lt", "==", "eq", "& lt; =", "le", "> =", "ge" "!" = "," "," "," - "," * "," / "," div ","% "," mod "," and "," & " ... "" "" "" "" ("Line 1, column 21.") was hoping: "..." ... "..." & gt; "..." Gt "..." & lt; "..." lt "..." == "..." eq "..." & lt; = "..." le "..."> ; = ".." "Ge" ... "! =" ... "has" ... "[" ... "+" ... ... "-" ... "*" .. ... ... "/" ... Div "..."% "..." mod "..." and "..." & "..." or "...". | "..."? ". ..   

and in the Stacktrace,

  javax.faces.el.reference.SyntaxException: myUnmanagedBean.fn ( ) Com.sun.faces.application.ApplicationImpl.checking syntax (unknown Source)   

This datacentext is for testing purposes only; I know that is not an ideal way to do this. What is the problem?

  1. Your EL is Remove brackets.
  2. You need gates and senders for your price
  3. Gates and the setters can not be stable
  4. If you want to use viewScope for your script Data reference, you need to implement java.io.Serializable

No comments:

Post a Comment