Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsf IllegalArgumentException using components  RSS feed

 
Fabio Olivetto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am calling this xhtml file


from a template using i have the search button an everything but when i try to run it i got javax.el.ELException: java.lang.IllegalArgumentException: Cannot convert example04_01a of type class java.lang.String to class javax.el.MethodExpression for sake of this thread the method only return a string, which is a xhtml page

How can i fix this ?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15813
76
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not 100% sure and I can't test it for you, but...:

This most likely happens because the value of the 'action' attribute of a commandButton component must be a method expression, and you are giving it a string in line 20. The string comes from the searchAuthors method.

I think you can solve it like this (not tested!):





 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!