1
I am developing a news system for a client, and I am going through a difficulty, at the moment that I will record the news at the bank, the following message:
java.lang.Illegalstateexception: There are two Rules that Matches the Uri '/noticias/persistir' with method POST: [Fixedmethodstrategy: /noticias/{listaUltimasNoticias} mais [POST]], [Fixedmethodstrategy: /noticias/persistir persist [POST]] with same Priority. Consider using @Path Priority attribute.
In my controller the persist method is like this:
Noticiascontroller.java
@Post("/noticias/persistir")
public void persistir(Noticia noticia){
[...]
}
And my edit or insert form is like this:
<form action="<c:url value='/noticias/persistir'/>" method="post"
class="form-horizontal" role="form">
<input type="hidden" class="form-control" placeholder=""
name="noticia.tipo" value="Noticia"/>
//corpo do formulário tudo correto
</form>
This form if inserting and editing has already worked, but started pointing out this error, what can it be? And how do I correct?
Considered using in controller
@Path("/noticias/persistir")
??– Wellington Avelino
@Wellingtonavelino I considered and tried to do but the msm error occurs
– Tiago Ferezin
You have created some other route with this same parameter
@Post("/noticias/persistir")
if created try to pass a type id{noticias.id}/persisitr
– Wellington Avelino
@Wellingtonavelino I did not create another route with this parameter, as I said, before it was running right, now started to appear this error ae, without me changing the controller and the form
– Tiago Ferezin