2

In some of my jsf i have a form. when user fill the form he/she can click on the button. on the following you can see a example of code that i use :

<h:commandButton styleClass="btn btn-primary btn-block" value="#{msg['button.add.share']}" action="#{AddShareControler.add}" />  

And in the AddShareControler i have a method called add with following structure :

public void add() throws DaoImplNotFoundException, DataSourceException, IOException{
    share.setUserId(id);
    ShareDao dao=(ShareDao) Factory.getDao(ConfigReader.getConfig().getProperty("dao.share"));
    dao.add(share);
    FacesContext.getCurrentInstance().getExternalContext().redirect("share.jsf?uid="+share.getUserId());
}  

But eclipse kepler give me a error in my xhtml file. this is the error that kelper give me :

Method must have signature "String method()" but has signature "void method()"

I know what is the reason of this Error. Beacuase Add method return void. but why eclipse juno don't give me any error for the same code. And how i can resolve it in the kepler?

thanks.

Rasoul Taheri
  • 802
  • 3
  • 16
  • 32
  • 1
    Check out this answer http://stackoverflow.com/questions/8083469/validation-error-on-valid-facelet-when-calling-action-method-with-parameter – disrvptor Dec 03 '13 at 14:19
  • This issue duplicates this question: http://stackoverflow.com/questions/8083469/method-must-have-signature-string-method-etc-but-has-signature-void – Jakob Hohlfeld Apr 10 '14 at 09:42

1 Answers1

2

I've recently installed eclipse Kepler. Making a simple spring-jsf app for testing, eclipse gave me the same error. You can continue, deploy and execute the app. Restarting eclipse error disappear. Then I think is an eclipse bug.

MACA
  • 21
  • 1