messageContext.add error

Asked

Viewed 62 times

2

According to the manual describes to insert a message we use the following command

messageContext.add(InfoMessages.BOOKMARK_INSERT_OK, bookmark.getDescription());

Only that the add method should only receive a "String message and Object... params" this generates an error because we are passing a Message type as it would be the correct to proceed ? I must inform thus:

messageContext.add(InfoMessages.BOOKMARK_INSERT_OK.getText(),
  bookmark.getDescription());

and also:

messageContext.add(InfoMessages.BOOKMARK_INSERT_OK.getText(),    
  InfoMessages.BOOKMARK_INSERT_OK.getSeverity(), bookmark.getDescription());

There should not be a method that receives the Message object ?

1 answer

0


Gustavo, if you take a look here in the reference documentation you will see that it is possible to pass an object Message for the method add of MessageContext. There is the following interface for this method: void add(Message message, Object... params), so it can receive 0 or more parameters in addition to the message.

  • So Emerson the documentation says yes, but using archetype Demoiselle-jsf-Parent version 2.5.0 the interface br.gov.frameworkdemoiselle.message.Messagecontext does not have the method that receives the Message object. I already updated the Maven project thinking that was the problem and the problem persists. I checked version 2.4.2 and this method exists as long as it is annotated with @Deprecated

  • Gustavo, in version 2.5 there seems to have been a real problem. The method was depreciated, and should have been replaced by the 'void add(Message message)' method, as indicated by this Issue (https://demoiselle.atlassian.net/browse/FWK-160). But it has been removed, and there has been no addition of the substitute method. Also, the documentation of this version is also outdated on this. I suggest you open two issues in the tracker (https://demoiselle.atlassian.net/projects/FWK/issues/FWK-228?filter=allopenissues) of the project, reporting the lack of the method, and the outdated documentation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.