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.