2

I have a backingBean with following method (signature):

public class SessionBean {
    ...
    public boolean subjectIsPermitted(final String permission);
    ...
}

In my jsf-template, I want to call this method dynamically, like this:

    ${sessionBean.subjectIsPermitted('company:manage:'company.id)}

Well, this concatenation within the method-call does throw a com.sun.el.parser.ParseException. Using "+" or "." to concat the String does not help, too.

How do I concat a String with a variable inside an EL-method-call?

Markus Schulte
  • 4,171
  • 3
  • 47
  • 58
  • possible duplicate of [Concatenating strings within EL expression defined in an attribute of a facelets tag](http://stackoverflow.com/questions/7386133/concatenating-strings-within-el-expression-defined-in-an-attribute-of-a-facelets) – Luiggi Mendoza Feb 12 '13 at 22:44

1 Answers1

4

Check this other question:

Combining a string with the value of a variable to be the name of another variable in EL

According to it, you can use:

<c:set var="variable" value="company:manage:${company.id}" />

before:

${sessionBean.subjectIsPermitted(variable)}

And that should work.

Regards,

Community
  • 1
  • 1
Rodmar Conde
  • 956
  • 1
  • 12
  • 24