Forum Stats

  • 3,815,470 Users
  • 2,259,032 Discussions
  • 7,893,112 Comments

Discussions

Jsf IllegalArgumentException using components

Fabio Olivetto
Fabio Olivetto Member Posts: 1
edited Oct 5, 2016 12:03AM in JavaServer Faces

I am calling this xhtml file

interface>    <cc:attribute name="searchAction"                  default="#{searchController.searchAuthors(compAuthorController.completeAuthorList)}"/></cc:interface><cc:implementation>    <h:form>        <h:outputText id="error" value="#{searchController.errorText}"/><br/>        <h:inputText id="searchText" styleClass="searchBox" size="75"                     value="#{searchController.searchText}"/>        <h:commandButton id="searchButton" value="SEARCH"                         action="#{cc.attrs.searchAction}"/>    </h:form></cc:implementation><cc:

from a template using  <util:search/> : I have the search button an everything but when i try to run it i got "<em><strong><a class="api" href="http://docs.oracle.com/javaee/7/api/javax/el/ELException.html" target="_new" title="Java API">javax.el.ELException</a>: <a class="api" href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html" target="_new" title="Java API">java.lang.IllegalArgumentException</a>: Cannot convert example04_01a of type class <a class="api" href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html" target="_new" title="Java API">java.lang.String</a> to class <a class="api" href="http://docs.oracle.com/javaee/7/api/javax/el/MethodExpression.html" target="_new" title="Java API">javax.el.MethodExpression</a></strong></em>" for sake of this thread the method <em><strong><code class="plain java">searchController.searchAuthors only returns the string "<code class="plain java"><em><strong>example04_01a</strong>" </em>which is the xhtml page i would like to display

public String searchAuthors(List<Author> list){

    return "example04_01a";

}

This discussion has been closed.