This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JSP and the fly likes el expression as parameter in el function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "el expression as parameter in el function" Watch "el expression as parameter in el function" New topic
Author

el expression as parameter in el function

Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Hello.

I have a tag file defined like this:



localeString is an el function defined in the tld like this:



when it tries to compile the tag file, the container ( glassfish 2.1) complains line this:



Can anyone help me by telling me exactly what am i doing wrong ? is it illegal to use an el expression as a string parameter of an el function ?

Thanks
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
figured it out: it should be
${mytags:localeString(language, "navbar.menubutton.label.users", "")}

not

${mytags:localeString(${language}, "navbar.menubutton.label.users", "")}
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63048
    
  69

This is a mistake a lot of people make -- thinking that ${} is some sort of operator. It's not. It encloses the entire EL expression and should never be nested within one.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Thanks Bear !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63048
    
  69

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: el expression as parameter in el function
 
It's not a secret anymore!